Re: [PATCH] davinci_vpfe: add a missing break

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/06/18 11:15, Mauro Carvalho Chehab wrote:
> As warned by gcc:
> 
> drivers/staging/media/davinci_vpfe/dm365_ipipeif.c: In function 'ipipeif_hw_setup':
> drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:298:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    switch (isif_port_if) {
>    ^~~~~~
> drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:314:2: note: here
>   case IPIPEIF_SDRAM_YUV:
>   ^~~~
> 
> There is a missing break for the raw format.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>

Nacked-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>

It really should fall through: see this comment:

                /* fall through for SDRAM YUV mode */
                /* configure CFG2 */
                val = ipipeif_read(ipipeif_base_addr, IPIPEIF_CFG2);
                switch (isif_port_if) {
                case MEDIA_BUS_FMT_YUYV8_1X16:
                case MEDIA_BUS_FMT_UYVY8_2X8:
                case MEDIA_BUS_FMT_Y8_1X8:
                        RESETBIT(val, IPIPEIF_CFG2_YUV8_SHIFT);
                        SETBIT(val, IPIPEIF_CFG2_YUV16_SHIFT);
                        ipipeif_write(val, ipipeif_base_addr, IPIPEIF_CFG2);
                        break;

                default:
                        RESETBIT(val, IPIPEIF_CFG2_YUV8_SHIFT);
                        RESETBIT(val, IPIPEIF_CFG2_YUV16_SHIFT);
                        ipipeif_write(val, ipipeif_base_addr, IPIPEIF_CFG2);
                        break;
                }

        case IPIPEIF_SDRAM_YUV:

So we need a proper /* fall through */ comment instead of a break.

In the SDRAM_YUV case the SDRAM clock divider is configured, and that needs
to be done for both SDRAM_* cases.

Regards,

	Hans


> ---
>  drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
> index a53231b08d30..975272bcf8ca 100644
> --- a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
> +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
> @@ -310,6 +310,7 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)
>  			ipipeif_write(val, ipipeif_base_addr, IPIPEIF_CFG2);
>  			break;
>  		}
> +		break;
>  
>  	case IPIPEIF_SDRAM_YUV:
>  		/* Set clock divider */
> 




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux