Re: [PATCH v10 03/10] media: platform: Add Renesas CEU driver

From: Hans Verkuil
Date: Thu Feb 22 2018 - 05:05:14 EST


On 02/21/18 18:47, Jacopo Mondi wrote:
> Add driver for Renesas Capture Engine Unit (CEU).
>
> The CEU interface supports capturing 'data' (YUV422) and 'images'
> (NV[12|21|16|61]).
>
> This driver aims to replace the soc_camera-based sh_mobile_ceu one.
>
> Tested with ov7670 camera sensor, providing YUYV_2X8 data on Renesas RZ
> platform GR-Peach.
>
> Tested with ov7725 camera sensor on SH4 platform Migo-R.
>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

I get these warnings when I try to compile this driver:


CC [M] drivers/media/platform/renesas-ceu.o
drivers/media/platform/renesas-ceu.c: In function âceu_start_streamingâ:
drivers/media/platform/renesas-ceu.c:290:2: warning: âcdwdrâ may be used uninitialized in this function [-Wmaybe-uninitialized]
iowrite32(data, priv->base + reg_offs);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/renesas-ceu.c:338:27: note: âcdwdrâ was declared here
u32 camcr, cdocr, cfzsr, cdwdr, capwr;
^~~~~
drivers/media/platform/renesas-ceu.c:290:2: warning: âcfzsrâ may be used uninitialized in this function [-Wmaybe-uninitialized]
iowrite32(data, priv->base + reg_offs);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/renesas-ceu.c:338:20: note: âcfzsrâ was declared here
u32 camcr, cdocr, cfzsr, cdwdr, capwr;
^~~~~
drivers/media/platform/renesas-ceu.c:418:8: warning: âcamcrâ may be used uninitialized in this function [-Wmaybe-uninitialized]
camcr |= mbus_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW ? 1 << 0 : 0;
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/renesas-ceu.c:338:6: note: âcamcrâ was declared here
u32 camcr, cdocr, cfzsr, cdwdr, capwr;
^~~~~
drivers/media/platform/renesas-ceu.c: In function âceu_probeâ:
drivers/media/platform/renesas-ceu.c:1632:9: warning: âretâ may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret;
^~~
cc1: some warnings being treated as errors

The last warning is indeed correct.

The others are only right if pixelformat is illegal, which can't happen.
I'd add a:

default:
return -EINVAL;

to the switch, this shuts up the warnings.

So I need a v11 (just for this patch) after all.

Regards,

Hans