[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210531174300.2594109-1-trix@redhat.com>
Date: Mon, 31 May 2021 10:43:00 -0700
From: trix@...hat.com
To: rmfrfs@...il.com, laurent.pinchart@...asonboard.com,
slongerbeam@...il.com, p.zabel@...gutronix.de, mchehab@...nel.org,
gregkh@...uxfoundation.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com
Cc: linux-media@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Tom Rix <trix@...hat.com>
Subject: [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default
From: Tom Rix <trix@...hat.com>
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 <trix@...hat.com>
---
drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index d573f3475d28..330f283030ec 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -1016,10 +1016,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;
}
--
2.26.3
Powered by blists - more mailing lists