lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 Aug 2020 14:33:27 -0500
From:   "Gustavo A. R. Silva" <gustavoars@...nel.org>
To:     Alex Dewar <alex.dewar90@...il.com>
Cc:     dennis.dalessandro@...el.com, dledford@...hat.com,
        gustavo@...eddedor.com, jgg@...pe.ca, joe@...ches.com,
        linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
        mike.marciniszyn@...el.com, roland@...estorage.com
Subject: Re: [PATCH v2 1/2] IB/qib: remove superfluous fallthrough statements

On Tue, Aug 25, 2020 at 06:12:42PM +0100, Alex Dewar wrote:
> Commit 36a8f01cd24b ("IB/qib: Add congestion control agent implementation")
> erroneously marked a couple of switch cases as /* FALLTHROUGH */, which
> were later converted to fallthrough statements by commit df561f6688fe
> ("treewide: Use fallthrough pseudo-keyword"). This triggered a Coverity
> warning about unreachable code.
>

It's worth mentioning that this warning is triggered only by compilers
that don't support __attribute__((__fallthrough__)), which has been
supported since GCC 7.1.

> Remove the fallthrough statements.
> 
> Addresses-Coverity: ("Unreachable code")
> Fixes: 36a8f01cd24b ("IB/qib: Add congestion control agent implementation")
> Signed-off-by: Alex Dewar <alex.dewar90@...il.com>

Reviewed-by: Gustavo A. R. Silva <gustavoars@...nel.org>

> ---
> v2: Do refactoring in a separate patch (Gustavo)
> ---

 ^^^
These dashes are not needed.

Thanks
--
Gustavo

>  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
> 

Powered by blists - more mailing lists