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  linux-cve-announce  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]
Message-ID: <8c969699-6ce3-4731-e33c-2d1b045aafab@microchip.com>
Date:   Thu, 29 Apr 2021 18:22:33 +0200
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
CC:     <claudiu.beznea@...rochip.com>, <kuba@...nel.org>,
        <davem@...emloft.net>, <linux@...linux.org.uk>,
        <palmer@...belt.com>, <paul.walmsley@...ive.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-riscv@...ts.infradead.org>
Subject: Re: [PATCH] net: macb: Remove redundant assignment to queue

On 29/04/2021 at 12:25, Jiapeng Chong wrote:
> Variable queue is set to bp->queues but these values is not used as it
> is overwritten later on, hence redundant assignment  can be removed.
> 
> Cleans up the following clang-analyzer warning:
> 
> drivers/net/ethernet/cadence/macb_main.c:4919:21: warning: Value stored
> to 'queue' during its initialization is never read
> [clang-analyzer-deadcode.DeadStores].
> 
> drivers/net/ethernet/cadence/macb_main.c:4832:21: warning: Value stored
> to 'queue' during its initialization is never read
> [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>

Looks good to me as assignments are done in for loops:
Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.com>

Regards,
   Nicolas

> ---
>   drivers/net/ethernet/cadence/macb_main.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 0f6a6cb..5693850 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4829,7 +4829,7 @@ static int __maybe_unused macb_suspend(struct device *dev)
>   {
>          struct net_device *netdev = dev_get_drvdata(dev);
>          struct macb *bp = netdev_priv(netdev);
> -       struct macb_queue *queue = bp->queues;
> +       struct macb_queue *queue;
>          unsigned long flags;
>          unsigned int q;
>          int err;
> @@ -4916,7 +4916,7 @@ static int __maybe_unused macb_resume(struct device *dev)
>   {
>          struct net_device *netdev = dev_get_drvdata(dev);
>          struct macb *bp = netdev_priv(netdev);
> -       struct macb_queue *queue = bp->queues;
> +       struct macb_queue *queue;
>          unsigned long flags;
>          unsigned int q;
>          int err;
> --
> 1.8.3.1
> 


-- 
Nicolas Ferre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ