* [PATCH] infiniband: remove unnecessary fallthrough usage
@ 2020-08-31 15:30 Cengiz Can
2020-08-31 15:34 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Cengiz Can @ 2020-08-31 15:30 UTC (permalink / raw)
To: Dennis Dalessandro, Mike Marciniszyn, Doug Ledford,
Jason Gunthorpe, Gustavo A . R . Silva
Cc: linux-rdma, linux-kernel, Cengiz Can
Since /* fallthrough */ comments are deprecated[1], they are being replaced
by new 'fallthrough' pseudo-keyword.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?\
highlight=fallthrough#implicit-switch-case-fall-through
This sometimes leads to unreachable code warnings by static analyzers,
particularly in this case, Coverity Scanner. (CID 1466512)
Remove unnecessary 'fallthrough' keywords to prevent dead code
warnings.
Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
---
drivers/infiniband/hw/qib/qib_mad.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
index e7789e724f56..f972e559a8a7 100644
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -2322,7 +2322,6 @@ static int process_cc(struct ib_device *ibdev, int mad_flags,
ret = cc_get_congestion_control_table(ccp, ibdev, port);
goto bail;
- fallthrough;
default:
ccp->status |= IB_SMP_UNSUP_METH_ATTR;
ret = reply((struct ib_smp *) ccp);
@@ -2339,7 +2338,6 @@ static int process_cc(struct ib_device *ibdev, int mad_flags,
ret = cc_set_congestion_control_table(ccp, ibdev, port);
goto bail;
- fallthrough;
default:
ccp->status |= IB_SMP_UNSUP_METH_ATTR;
ret = reply((struct ib_smp *) ccp);
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] infiniband: remove unnecessary fallthrough usage
2020-08-31 15:30 [PATCH] infiniband: remove unnecessary fallthrough usage Cengiz Can
@ 2020-08-31 15:34 ` Jason Gunthorpe
2020-08-31 16:00 ` Cengiz Can
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2020-08-31 15:34 UTC (permalink / raw)
To: Cengiz Can
Cc: Dennis Dalessandro, Mike Marciniszyn, Doug Ledford,
Gustavo A . R . Silva, linux-rdma, linux-kernel
On Mon, Aug 31, 2020 at 06:30:34PM +0300, Cengiz Can wrote:
> Since /* fallthrough */ comments are deprecated[1], they are being replaced
> by new 'fallthrough' pseudo-keyword.
>
> [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?\
> highlight=fallthrough#implicit-switch-case-fall-through
>
> This sometimes leads to unreachable code warnings by static analyzers,
> particularly in this case, Coverity Scanner. (CID 1466512)
>
> Remove unnecessary 'fallthrough' keywords to prevent dead code
> warnings.
>
> Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
> ---
> drivers/infiniband/hw/qib/qib_mad.c | 2 --
> 1 file changed, 2 deletions(-)
Alex beat you to it:
https://patchwork.kernel.org/patch/11736039/
Thanks,
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] infiniband: remove unnecessary fallthrough usage
2020-08-31 15:34 ` Jason Gunthorpe
@ 2020-08-31 16:00 ` Cengiz Can
0 siblings, 0 replies; 3+ messages in thread
From: Cengiz Can @ 2020-08-31 16:00 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Dennis Dalessandro, Mike Marciniszyn, Doug Ledford,
Gustavo A . R . Silva, linux-rdma, linux-kernel
On 2020-08-31 18:34, Jason Gunthorpe wrote:
> On Mon, Aug 31, 2020 at 06:30:34PM +0300, Cengiz Can wrote:
>> Since /* fallthrough */ comments are deprecated[1], they are being
>> replaced
>> by new 'fallthrough' pseudo-keyword.
>>
>> [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?\
>> highlight=fallthrough#implicit-switch-case-fall-through
>>
>> This sometimes leads to unreachable code warnings by static analyzers,
>> particularly in this case, Coverity Scanner. (CID 1466512)
>>
>> Remove unnecessary 'fallthrough' keywords to prevent dead code
>> warnings.
>>
>> Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
>> ---
>> drivers/infiniband/hw/qib/qib_mad.c | 2 --
>> 1 file changed, 2 deletions(-)
>
> Alex beat you to it:
>
> https://patchwork.kernel.org/patch/11736039/
Well, I'm glad it's fixed :)
Thanks for sharing
>
> Thanks,
> Jason
--
Cengiz Can
@cengiz_io
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-31 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 15:30 [PATCH] infiniband: remove unnecessary fallthrough usage Cengiz Can
2020-08-31 15:34 ` Jason Gunthorpe
2020-08-31 16:00 ` Cengiz Can
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox