media: coda: do not reassign ctx->tiled_map_type in coda_s_fmt
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 23 Jun 2017 11:57:27 +0000 (07:57 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 19 Jul 2017 19:19:10 +0000 (15:19 -0400)
This smatch warning:

    coda/coda-common.c:706 coda_s_fmt() warn: missing break? reassigning 'ctx->tiled_map_type'

can be silenced by moving the ctx->tiled_map_type assignment into the
breakout condition. That way the field is not reassigned when falling
through to the next switch statement.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/coda/coda-common.c

index d119b47..90c061e 100644 (file)
@@ -714,9 +714,10 @@ static int coda_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f,
                ctx->tiled_map_type = GDI_TILED_FRAME_MB_RASTER_MAP;
                break;
        case V4L2_PIX_FMT_NV12:
-               ctx->tiled_map_type = GDI_TILED_FRAME_MB_RASTER_MAP;
-               if (!disable_tiling)
+               if (!disable_tiling) {
+                       ctx->tiled_map_type = GDI_TILED_FRAME_MB_RASTER_MAP;
                        break;
+               }
                /* else fall through */
        case V4L2_PIX_FMT_YUV420:
        case V4L2_PIX_FMT_YVU420: