diff mbox series

[ipsec-next,v2] sky2: Remove redundant assignment and parentheses

Message ID 20211028031551.11209-1-luo.penghao@zte.com.cn (mailing list archive)
State Accepted
Commit 6a03bfbd5eade19e1943551abba2acd4d9079762
Delegated to: Netdev Maintainers
Headers show
Series [ipsec-next,v2] sky2: Remove redundant assignment and parentheses | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: luo penghao <cgel.zte@gmail.com>' != 'Signed-off-by: luo penghao <luo.penghao@zte.com.cn>'
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

CGEL Oct. 28, 2021, 3:15 a.m. UTC
The variable err will be reassigned on subsequent branches, and this
assignment does not perform related value operations. This will cause
the double parentheses to be redundant, so the inner parentheses should
be deleted.

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

Changes in v2:

modify title category:octeontx2-af to sky2.
delete the inner parentheses.

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

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 28, 2021, 1:50 p.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 28 Oct 2021 03:15:51 +0000 you wrote:
> The variable err will be reassigned on subsequent branches, and this
> assignment does not perform related value operations. This will cause
> the double parentheses to be redundant, so the inner parentheses should
> be deleted.
> 
> clang_analyzer complains as follows:
> 
> [...]

Here is the summary with links:
  - [ipsec-next,v2] sky2: Remove redundant assignment and parentheses
    https://git.kernel.org/netdev/net-next/c/6a03bfbd5ead

You are awesome, thank you!
Jakub Kicinski Oct. 28, 2021, 2:55 p.m. UTC | #2
On Thu, 28 Oct 2021 03:15:51 +0000 luo penghao wrote:
> The variable err will be reassigned on subsequent branches, and this
> assignment does not perform related value operations. This will cause
> the double parentheses to be redundant, so the inner parentheses should
> be deleted.

Why the "ipsec-next" in the subject? :)
diff mbox series

Patch

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