From: Tom Rix Date: Mon, 31 May 2021 17:43:00 +0000 (+0200) Subject: media: imx: imx7_mipi_csis: convert some switch cases to the default X-Git-Tag: v5.15-rc1~149^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43c3f12dfbbda169b06715bf0b090ca1b1201058;p=thirdparty%2Fkernel%2Flinux.git media: imx: imx7_mipi_csis: convert some switch cases to the default Static analysis reports this false positive imx7-mipi-csis.c:1027:2: warning: 4th function call argument is an uninitialized value The variable 'align' is falsely reported as uninitialized. Even though all the cases are covered in the switch (csis_fmt->width % 8) { Because there is no default case, it is reported as uninialized. Improve the switch by converting the most numerous set of cases to the default and silence the false positive. Signed-off-by: Tom Rix Reviewed-by: Rui Miguel Silva Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index ead696eb46103..41e33535de552 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -1019,10 +1019,8 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd, case 6: align = 2; break; - case 1: - case 3: - case 5: - case 7: + default: + /* 1, 3, 5, 7 */ align = 3; break; }