All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] octeontx2-af: Remove redundant assignment operations
@ 2021-10-21  6:50 luo penghao
  2021-10-22 18:08 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: luo penghao @ 2021-10-21  6:50 UTC (permalink / raw)
  To: SimonHorman
  Cc: Mirko Lindner, David S . Miller, Jakub Kicinski, netdev,
	linux-kernel, luo penghao, Zeal Robot

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: luo penghao <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 8b8bff5..33558aa 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4985,7 +4985,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))) {
 		using_dac = 1;
 		err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
 		if (err < 0) {
-- 
2.15.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH linux-next] octeontx2-af: Remove redundant assignment operations
  2021-10-21  6:50 [PATCH linux-next] octeontx2-af: Remove redundant assignment operations luo penghao
@ 2021-10-22 18:08 ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2021-10-22 18:08 UTC (permalink / raw)
  To: luo penghao
  Cc: SimonHorman, Mirko Lindner, David S . Miller, netdev,
	luo penghao, Zeal Robot

On Thu, 21 Oct 2021 06:50:19 +0000 luo penghao wrote:
> 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'.

Oh you did CC Mirko on this version.. Do you not have the CCs automated?
scripts/get_maintainer.pl is your friend.

If you're posting a new version of the patch please put [PATCH v2] as
the subject prefix. And stop putting the pointless linux-next there.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH linux-next] octeontx2-af: Remove redundant assignment operations
  2021-10-18  9:16 luo penghao
@ 2021-10-20  9:18 ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2021-10-20  9:18 UTC (permalink / raw)
  To: luo penghao
  Cc: Mirko Lindner, Stephen Hemminger, David S . Miller,
	Jakub Kicinski, netdev, linux-kernel, penghao luo, Zeal Robot

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH linux-next] octeontx2-af: Remove redundant assignment operations
@ 2021-10-18  9:16 luo penghao
  2021-10-20  9:18 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: luo penghao @ 2021-10-18  9:16 UTC (permalink / raw)
  To: Mirko Lindner
  Cc: Stephen Hemminger, David S . Miller, Jakub Kicinski, netdev,
	linux-kernel, penghao luo, Zeal Robot

From: penghao luo <luo.penghao@zte.com.cn>

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-22 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  6:50 [PATCH linux-next] octeontx2-af: Remove redundant assignment operations luo penghao
2021-10-22 18:08 ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2021-10-18  9:16 luo penghao
2021-10-20  9:18 ` Simon Horman

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.