All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: luo penghao <cgel.zte@gmail.com>
Cc: Mirko Lindner <mlindner@marvell.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	penghao luo <luo.penghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] octeontx2-af: Remove redundant assignment operations
Date: Wed, 20 Oct 2021 11:18:53 +0200	[thread overview]
Message-ID: <20211020091853.GD3935@kernel.org> (raw)
In-Reply-To: <20211018091612.858462-1-luo.penghao@zte.com.cn>

On Mon, Oct 18, 2021 at 09:16:12AM +0000, luo penghao wrote:
> From: penghao luo <luo.penghao@zte.com.cn>

I think the correct patch-prefix for this would be:

[PATCH net-next] sky2:

> 
> the variable err will be reassigned on subsequent branches, and this
> assignment does not perform related value operations.
> 
> clang_analyzer complains as follows:
> 
> drivers/net/ethernet/marvell/sky2.c:4988: warning:
> 
> Although the value stored to 'err' is used in the enclosing expression,
> the value is never actually read from 'err'.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: penghao luo <luo.penghao@zte.com.cn>
> ---
>  drivers/net/ethernet/marvell/sky2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
> index 3cb9c12..6428ae5 100644
> --- a/drivers/net/ethernet/marvell/sky2.c
> +++ b/drivers/net/ethernet/marvell/sky2.c
> @@ -4907,7 +4907,7 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	pci_set_master(pdev);
>  
>  	if (sizeof(dma_addr_t) > sizeof(u32) &&
> -	    !(err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))) {
> +	    !(dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))) {

I think you can drop the parentheses around the call to dma_set_mask()

>  		using_dac = 1;
>  		err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
>  		if (err < 0) {
> -- 
> 2.15.2
> 
> 

  reply	other threads:[~2021-10-20  9:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  9:16 [PATCH linux-next] octeontx2-af: Remove redundant assignment operations luo penghao
2021-10-20  9:18 ` Simon Horman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-21  6:50 luo penghao
2021-10-22 18:08 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020091853.GD3935@kernel.org \
    --to=horms@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luo.penghao@zte.com.cn \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.