diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-11-22 10:20:50 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-11-29 10:15:04 +0100 |
commit | c9ae8eed446322fc2d1c9e6bf4ac78b4e5686cad (patch) | |
tree | d342c542f990737bee235b902283127a8983e226 /drivers/media/platform/omap3isp | |
parent | media: omap3isp: mark isp_isr_dbg as __maybe_unused (diff) | |
download | linux-c9ae8eed446322fc2d1c9e6bf4ac78b4e5686cad.tar.xz linux-c9ae8eed446322fc2d1c9e6bf4ac78b4e5686cad.zip |
media: omap3isp: avoid warnings at IS_OUT_OF_BOUNDS()
Clang with W=1 produces the following warnings:
drivers/media/platform/omap3isp/isph3a_af.c:173:6: error: result of comparison of constant 256 with expression of type '__u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (IS_OUT_OF_BOUNDS(paxel_cfg->height, OMAP3ISP_AF_PAXEL_HEIGHT_MIN,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/omap3isp/isph3a_af.c:24:33: note: expanded from macro 'IS_OUT_OF_BOUNDS'
(((value) < (min)) || ((value) > (max)))
~~~~~~~ ^ ~~~~~
drivers/media/platform/omap3isp/isph3a_af.c:179:6: error: result of comparison of constant 256 with expression of type '__u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (IS_OUT_OF_BOUNDS(paxel_cfg->width, OMAP3ISP_AF_PAXEL_WIDTH_MIN,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/omap3isp/isph3a_af.c:24:33: note: expanded from macro 'IS_OUT_OF_BOUNDS'
(((value) < (min)) || ((value) > (max)))
~~~~~~~ ^ ~~~~~
2 errors generated.
Use a typecast to avoid such warnings.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/omap3isp')
-rw-r--r-- | drivers/media/platform/omap3isp/isph3a_af.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/omap3isp/isph3a_af.c b/drivers/media/platform/omap3isp/isph3a_af.c index a65cfdfa9637..de7b116d0122 100644 --- a/drivers/media/platform/omap3isp/isph3a_af.c +++ b/drivers/media/platform/omap3isp/isph3a_af.c @@ -21,7 +21,7 @@ #include "ispstat.h" #define IS_OUT_OF_BOUNDS(value, min, max) \ - (((value) < (min)) || ((value) > (max))) + ((((unsigned int)value) < (min)) || (((unsigned int)value) > (max))) static void h3a_af_setup_regs(struct ispstat *af, void *priv) { |