* [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default
@ 2021-05-31 17:43 trix
2021-06-01 11:03 ` Rui Miguel Silva
2021-06-01 12:46 ` Laurent Pinchart
0 siblings, 2 replies; 3+ messages in thread
From: trix @ 2021-05-31 17:43 UTC (permalink / raw
To: rmfrfs, laurent.pinchart, slongerbeam, p.zabel, mchehab, gregkh,
shawnguo, s.hauer, kernel, festevam, linux-imx
Cc: linux-media, linux-staging, linux-arm-kernel, linux-kernel,
Tom Rix
From: Tom Rix <trix@redhat.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@redhat.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default
2021-05-31 17:43 [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default trix
@ 2021-06-01 11:03 ` Rui Miguel Silva
2021-06-01 12:46 ` Laurent Pinchart
1 sibling, 0 replies; 3+ messages in thread
From: Rui Miguel Silva @ 2021-06-01 11:03 UTC (permalink / raw
To: trix, laurent.pinchart, slongerbeam, p.zabel, mchehab, gregkh,
shawnguo, s.hauer, kernel, festevam, linux-imx
Cc: linux-media, linux-staging, linux-arm-kernel, linux-kernel
Hi Tom,
Thanks for the patch.
On Mon May 31, 2021 at 6:43 PM WEST, wrote:
> From: Tom Rix <trix@redhat.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@redhat.com>
It solves that, looks good to me.
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
------
Cheers,
Rui
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default
2021-05-31 17:43 [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default trix
2021-06-01 11:03 ` Rui Miguel Silva
@ 2021-06-01 12:46 ` Laurent Pinchart
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2021-06-01 12:46 UTC (permalink / raw
To: trix
Cc: rmfrfs, slongerbeam, p.zabel, mchehab, gregkh, shawnguo, s.hauer,
kernel, festevam, linux-imx, linux-media, linux-staging,
linux-arm-kernel, linux-kernel
Hi Tom,
Thank you for the patch.
On Mon, May 31, 2021 at 10:43:00AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.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@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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;
> }
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-01 12:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 17:43 [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default trix
2021-06-01 11:03 ` Rui Miguel Silva
2021-06-01 12:46 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).