]> asedeno.scripts.mit.edu Git - linux.git/commit
media: v4l2-common: fix a compilation breakage
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 21 Mar 2018 19:48:11 +0000 (15:48 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 21 Mar 2018 20:07:01 +0000 (16:07 -0400)
commit238f694e1b7f8297f1256c57e41f69c39576c9b4
tree778caae48fdab20eb720f61ff2c9eab59c428a50
parent35c6ef89661cb3a1d8767e70fbbb914bfcce776c
media: v4l2-common: fix a compilation breakage

Clearly, changeset 95ce9c28601a ("media: v4l: common: Add a
function to obtain best size from a list") was never tested, as it
broke compilation with:

drivers/media/platform/vivid/vivid-vid-cap.c: In function ‘vivid_try_fmt_vid_cap’:
drivers/media/platform/vivid/vivid-vid-cap.c:565:34: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
             mp->width, mp->height);
                                  ^
drivers/media/platform/vivid/vivid-vid-cap.c:564:4: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
    v4l2_find_nearest_size(webcam_sizes, width, height,
    ^~~~~~~~~~~~~~~~~~~~~~
    __v4l2_find_nearest_size
drivers/media/platform/vivid/vivid-vid-cap.c:564:4: note: each undeclared identifier is reported only once for each function it appears in
drivers/media/i2c/ov5670.c: In function ‘ov5670_set_pad_format’:
drivers/media/i2c/ov5670.c:2233:48: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
           fmt->format.width, fmt->format.height);
                                                ^
drivers/media/i2c/ov5670.c:2232:9: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
  mode = v4l2_find_nearest_size(supported_modes, width, height,
         ^~~~~~~~~~~~~~~~~~~~~~
         __v4l2_find_nearest_size
drivers/media/i2c/ov13858.c: In function ‘ov13858_set_pad_format’:
drivers/media/i2c/ov13858.c:1379:48: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
           fmt->format.width, fmt->format.height);
                                                ^
drivers/media/i2c/ov13858.c:1378:9: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
  mode = v4l2_find_nearest_size(supported_modes, width, height,
         ^~~~~~~~~~~~~~~~~~~~~~
         __v4l2_find_nearest_size
drivers/media/i2c/ov13858.c:1378:9: note: each undeclared identifier is reported only once for each function it appears in

Basically, v4l2_find_nearest_size() callers pass 5 arguments,
while its definition require 6 args.

Unfortunately, my build process was also broken, as it was reporting me that
the compilation went fine:

$ make ARCH=i386  CF=-D__CHECK_ENDIAN__ CONFIG_DEBUG_SECTION_MISMATCH=y C=1 W=1 CHECK='compile_checks' M=drivers/staging/media
$ make ARCH=i386  CF=-D__CHECK_ENDIAN__ CONFIG_DEBUG_SECTION_MISMATCH=y C=1 W=1 CHECK='compile_checks' M=drivers/media

*** ERRORS ***

*** WARNINGS ***
compilation succeeded

That was due to a change here to use of linux-log-diff script that
provides a diffstat between the errors output. Somehow, the logic
was missing some fatal errors.

Fixes: 95ce9c28601a ("media: v4l: common: Add a function to obtain best size from a list")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
include/media/v4l2-common.h