infiniband: remove unnecessary fallthrough usage
PATCH 1/1 infiniband: remove unnecessary fallthrough usage
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.
--- drivers/infiniband/hw/qib/qib_mad.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/hw/qib/qib_mad.c +0 -2
@@ -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);
Signature · 1 line
2.28.0
Quoted 9 lines · 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-throughThis sometimes leads to unreachable code warnings by static analyzers, particularly in this case, Coverity Scanner. (CID 1466512)
Quoted 7 lines
Remove unnecessary 'fallthrough' keywords to prevent dead code warnings.
Signed-off-by Cengiz Can <[email protected]>--- 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
Quoted 13 lines · Jason Gunthorpe
Quoted 12 lines · 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-throughThis 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.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Cengiz Can <[email protected]>--- drivers/infiniband/hw/qib/qib_mad.c | 2 -- 1 file changed, 2 deletions(-)Alex beat you to it:
Well, I'm glad it's fixed :)
Thanks for sharing
Quoted 3 lines
Thanks,
Jason
Signature · 2 lines
Cengiz Can @cengiz_io