* [PATCH] media: imx: shut up a false positive warning
@ 2018-08-07 9:58 Mauro Carvalho Chehab
2018-08-07 11:00 ` Ian Arkver
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2018-08-07 9:58 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Mauro Carvalho Chehab, Steve Longerbeam, Philipp Zabel,
Greg Kroah-Hartman, devel
With imx, gcc produces a false positive warning:
drivers/staging/media/imx/imx-media-csi.c: In function 'csi_idmac_setup_channel':
drivers/staging/media/imx/imx-media-csi.c:457:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (passthrough) {
^
drivers/staging/media/imx/imx-media-csi.c:464:2: note: here
default:
^~~~~~~
That's because the regex it uses for fall trough is not
good enough. So, rearrange the fall through comment in a way
that gcc will recognize.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
drivers/staging/media/imx/imx-media-csi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 4647206f92ca..b7ffd231c64b 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -460,7 +460,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv)
passthrough_cycles = incc->cycles;
break;
}
- /* fallthrough for non-passthrough RGB565 (CSI-2 bus) */
+ /* for non-passthrough RGB565 (CSI-2 bus) */
+ /* Falls through */
default:
burst_size = (image.pix.width & 0xf) ? 8 : 16;
passthrough_bits = 16;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: imx: shut up a false positive warning
2018-08-07 9:58 [PATCH] media: imx: shut up a false positive warning Mauro Carvalho Chehab
@ 2018-08-07 11:00 ` Ian Arkver
2018-08-07 11:47 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 3+ messages in thread
From: Ian Arkver @ 2018-08-07 11:00 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Linux Media Mailing List, Mauro Carvalho Chehab, Steve Longerbeam,
Philipp Zabel, Greg Kroah-Hartman, devel
Hi Mauro,
On 07/08/18 10:58, Mauro Carvalho Chehab wrote:
> With imx, gcc produces a false positive warning:
>
> drivers/staging/media/imx/imx-media-csi.c: In function 'csi_idmac_setup_channel':
> drivers/staging/media/imx/imx-media-csi.c:457:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (passthrough) {
> ^
> drivers/staging/media/imx/imx-media-csi.c:464:2: note: here
> default:
> ^~~~~~~
>
> That's because the regex it uses for fall trough is not
> good enough. So, rearrange the fall through comment in a way
> that gcc will recognize.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
> drivers/staging/media/imx/imx-media-csi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> index 4647206f92ca..b7ffd231c64b 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -460,7 +460,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv)
> passthrough_cycles = incc->cycles;
> break;
> }
> - /* fallthrough for non-passthrough RGB565 (CSI-2 bus) */
> + /* for non-passthrough RGB565 (CSI-2 bus) */
> + /* Falls through */
Adding a '-' to the fallthrough seems to meet the regex requirements at
level 3 of the warning. Eg...
/* fallthrough- for non-passthrough RGB565 (CSI-2 bus) */
Not sure if this is an improvement though.
Regards,
Ian
> default:
> burst_size = (image.pix.width & 0xf) ? 8 : 16;
> passthrough_bits = 16;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: imx: shut up a false positive warning
2018-08-07 11:00 ` Ian Arkver
@ 2018-08-07 11:47 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2018-08-07 11:47 UTC (permalink / raw)
To: Ian Arkver
Cc: Linux Media Mailing List, Mauro Carvalho Chehab, Steve Longerbeam,
Philipp Zabel, Greg Kroah-Hartman, devel
Em Tue, 7 Aug 2018 12:00:46 +0100
Ian Arkver <ian.arkver.dev@gmail.com> escreveu:
> Hi Mauro,
>
> On 07/08/18 10:58, Mauro Carvalho Chehab wrote:
> > With imx, gcc produces a false positive warning:
> >
> > drivers/staging/media/imx/imx-media-csi.c: In function 'csi_idmac_setup_channel':
> > drivers/staging/media/imx/imx-media-csi.c:457:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (passthrough) {
> > ^
> > drivers/staging/media/imx/imx-media-csi.c:464:2: note: here
> > default:
> > ^~~~~~~
> >
> > That's because the regex it uses for fall trough is not
> > good enough. So, rearrange the fall through comment in a way
> > that gcc will recognize.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> > ---
> > drivers/staging/media/imx/imx-media-csi.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> > index 4647206f92ca..b7ffd231c64b 100644
> > --- a/drivers/staging/media/imx/imx-media-csi.c
> > +++ b/drivers/staging/media/imx/imx-media-csi.c
> > @@ -460,7 +460,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv)
> > passthrough_cycles = incc->cycles;
> > break;
> > }
> > - /* fallthrough for non-passthrough RGB565 (CSI-2 bus) */
> > + /* for non-passthrough RGB565 (CSI-2 bus) */
> > + /* Falls through */
>
> Adding a '-' to the fallthrough seems to meet the regex requirements at
> level 3 of the warning. Eg...
>
> /* fallthrough- for non-passthrough RGB565 (CSI-2 bus) */
>
> Not sure if this is an improvement though.
Hmm... this also works:
/* fallthrough - non-passthrough RGB565 (CSI-2 bus) */
I would actually prefer a ':' instead of '-', but that works too,
and it could be better than splitting fall through messages on
two comments.
Thanks,
Mauro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-07 14:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 9:58 [PATCH] media: imx: shut up a false positive warning Mauro Carvalho Chehab
2018-08-07 11:00 ` Ian Arkver
2018-08-07 11:47 ` Mauro Carvalho Chehab
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 NNTP newsgroup(s).