* [PATCH] drm/dp: annotate implicit fall throughs
@ 2019-01-14 20:27 Mathieu Malaterre
2019-01-14 21:13 ` Gustavo A. R. Silva
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:27 UTC (permalink / raw)
To: Maarten Lankhorst
Cc: Mathieu Malaterre, Maxime Ripard, Sean Paul, David Airlie,
Daniel Vetter, dri-devel, linux-kernel
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings (W=1). Fix them up.
This commit remove the following warnings:
include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
drivers/gpu/drm/drm_dp_helper.c:155:3: note: in expansion of macro 'WARN'
include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
drivers/gpu/drm/drm_dp_helper.c:173:3: note: in expansion of macro 'WARN'
drivers/gpu/drm/drm_dp_helper.c:547:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
drivers/gpu/drm/drm_dp_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 516e82d0ed50..26835d174939 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -154,6 +154,7 @@ u8 drm_dp_link_rate_to_bw_code(int link_rate)
default:
WARN(1, "unknown DP link rate %d, using %x\n", link_rate,
DP_LINK_BW_1_62);
+ /* fall through */
case 162000:
return DP_LINK_BW_1_62;
case 270000:
@@ -171,6 +172,7 @@ int drm_dp_bw_code_to_link_rate(u8 link_bw)
switch (link_bw) {
default:
WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw);
+ /* fall through */
case DP_LINK_BW_1_62:
return 162000;
case DP_LINK_BW_2_7:
@@ -552,6 +554,7 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
case DP_DS_16BPC:
return 16;
}
+ /* fall through */
default:
return 0;
}
--
2.19.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/dp: annotate implicit fall throughs
2019-01-14 20:27 [PATCH] drm/dp: annotate implicit fall throughs Mathieu Malaterre
@ 2019-01-14 21:13 ` Gustavo A. R. Silva
2019-01-15 11:50 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-14 21:13 UTC (permalink / raw)
To: Mathieu Malaterre, Maarten Lankhorst
Cc: Maxime Ripard, Sean Paul, David Airlie, Daniel Vetter, dri-devel,
linux-kernel
On 1/14/19 2:27 PM, Mathieu Malaterre wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings (W=1). Fix them up.
>
> This commit remove the following warnings:
>
> include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> drivers/gpu/drm/drm_dp_helper.c:155:3: note: in expansion of macro 'WARN'
> include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> drivers/gpu/drm/drm_dp_helper.c:173:3: note: in expansion of macro 'WARN'
> drivers/gpu/drm/drm_dp_helper.c:547:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/gpu/drm/drm_dp_helper.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 516e82d0ed50..26835d174939 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -154,6 +154,7 @@ u8 drm_dp_link_rate_to_bw_code(int link_rate)
> default:
> WARN(1, "unknown DP link rate %d, using %x\n", link_rate,
> DP_LINK_BW_1_62);
> + /* fall through */
> case 162000:
> return DP_LINK_BW_1_62;
> case 270000:
> @@ -171,6 +172,7 @@ int drm_dp_bw_code_to_link_rate(u8 link_bw)
> switch (link_bw) {
> default:
> WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw);
> + /* fall through */
> case DP_LINK_BW_1_62:
> return 162000;
> case DP_LINK_BW_2_7:
> @@ -552,6 +554,7 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> case DP_DS_16BPC:
> return 16;
> }
> + /* fall through */
> default:
> return 0;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/dp: annotate implicit fall throughs
2019-01-14 21:13 ` Gustavo A. R. Silva
@ 2019-01-15 11:50 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-01-15 11:50 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Mathieu Malaterre, Maarten Lankhorst, Maxime Ripard, Sean Paul,
David Airlie, Daniel Vetter, dri-devel, linux-kernel
On Mon, Jan 14, 2019 at 03:13:29PM -0600, Gustavo A. R. Silva wrote:
>
>
> On 1/14/19 2:27 PM, Mathieu Malaterre wrote:
> > There is a plan to build the kernel with -Wimplicit-fallthrough and
> > these places in the code produced warnings (W=1). Fix them up.
> >
> > This commit remove the following warnings:
> >
> > include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> > drivers/gpu/drm/drm_dp_helper.c:155:3: note: in expansion of macro 'WARN'
> > include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> > drivers/gpu/drm/drm_dp_helper.c:173:3: note: in expansion of macro 'WARN'
> > drivers/gpu/drm/drm_dp_helper.c:547:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >
> > Signed-off-by: Mathieu Malaterre <malat@debian.org>
> Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Thanks for your patch, applied.
-Daniel
>
> > ---
> > drivers/gpu/drm/drm_dp_helper.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > index 516e82d0ed50..26835d174939 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -154,6 +154,7 @@ u8 drm_dp_link_rate_to_bw_code(int link_rate)
> > default:
> > WARN(1, "unknown DP link rate %d, using %x\n", link_rate,
> > DP_LINK_BW_1_62);
> > + /* fall through */
> > case 162000:
> > return DP_LINK_BW_1_62;
> > case 270000:
> > @@ -171,6 +172,7 @@ int drm_dp_bw_code_to_link_rate(u8 link_bw)
> > switch (link_bw) {
> > default:
> > WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw);
> > + /* fall through */
> > case DP_LINK_BW_1_62:
> > return 162000;
> > case DP_LINK_BW_2_7:
> > @@ -552,6 +554,7 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > case DP_DS_16BPC:
> > return 16;
> > }
> > + /* fall through */
> > default:
> > return 0;
> > }
> >
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/dp: annotate implicit fall throughs
@ 2019-01-15 11:50 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-01-15 11:50 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Mathieu Malaterre, David Airlie, linux-kernel, dri-devel,
Maxime Ripard, Sean Paul
On Mon, Jan 14, 2019 at 03:13:29PM -0600, Gustavo A. R. Silva wrote:
>
>
> On 1/14/19 2:27 PM, Mathieu Malaterre wrote:
> > There is a plan to build the kernel with -Wimplicit-fallthrough and
> > these places in the code produced warnings (W=1). Fix them up.
> >
> > This commit remove the following warnings:
> >
> > include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> > drivers/gpu/drm/drm_dp_helper.c:155:3: note: in expansion of macro 'WARN'
> > include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > include/asm-generic/bug.h:134:2: note: in expansion of macro 'unlikely'
> > drivers/gpu/drm/drm_dp_helper.c:173:3: note: in expansion of macro 'WARN'
> > drivers/gpu/drm/drm_dp_helper.c:547:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >
> > Signed-off-by: Mathieu Malaterre <malat@debian.org>
> Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Thanks for your patch, applied.
-Daniel
>
> > ---
> > drivers/gpu/drm/drm_dp_helper.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > index 516e82d0ed50..26835d174939 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -154,6 +154,7 @@ u8 drm_dp_link_rate_to_bw_code(int link_rate)
> > default:
> > WARN(1, "unknown DP link rate %d, using %x\n", link_rate,
> > DP_LINK_BW_1_62);
> > + /* fall through */
> > case 162000:
> > return DP_LINK_BW_1_62;
> > case 270000:
> > @@ -171,6 +172,7 @@ int drm_dp_bw_code_to_link_rate(u8 link_bw)
> > switch (link_bw) {
> > default:
> > WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw);
> > + /* fall through */
> > case DP_LINK_BW_1_62:
> > return 162000;
> > case DP_LINK_BW_2_7:
> > @@ -552,6 +554,7 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > case DP_DS_16BPC:
> > return 16;
> > }
> > + /* fall through */
> > default:
> > return 0;
> > }
> >
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-15 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 20:27 [PATCH] drm/dp: annotate implicit fall throughs Mathieu Malaterre
2019-01-14 21:13 ` Gustavo A. R. Silva
2019-01-15 11:50 ` Daniel Vetter
2019-01-15 11:50 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.