kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][V2] net: dsa: b53: remove redundant null check on dev
@ 2021-06-15  9:05 Colin King
  2021-06-15 14:10 ` Florian Fainelli
  2021-06-15 18:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-06-15  9:05 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	David S . Miller, Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer dev can never be null, the null check is redundant
and can be removed. Cleans up a static analysis warning that
pointer priv is dereferencing dev before dev is being null
checked.

Addresses-Coverity: ("Dereference before null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---

V2: Remove null check rather than add b53_srab_intr_set call into a null
    check statement block.
    Rephrase commit Subject to reflect the change in the fix.

---
 drivers/net/dsa/b53/b53_srab.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index aaa12d73784e..3f4249de70c5 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -632,8 +632,7 @@ static int b53_srab_remove(struct platform_device *pdev)
 	struct b53_srab_priv *priv = dev->priv;
 
 	b53_srab_intr_set(priv, false);
-	if (dev)
-		b53_switch_remove(dev);
+	b53_switch_remove(dev);
 
 	return 0;
 }
-- 
2.31.1


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

* Re: [PATCH][V2] net: dsa: b53: remove redundant null check on dev
  2021-06-15  9:05 [PATCH][V2] net: dsa: b53: remove redundant null check on dev Colin King
@ 2021-06-15 14:10 ` Florian Fainelli
  2021-06-15 18:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-06-15 14:10 UTC (permalink / raw)
  To: Colin King, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	David S . Miller, Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel



On 6/15/2021 2:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer dev can never be null, the null check is redundant
> and can be removed. Cleans up a static analysis warning that
> pointer priv is dereferencing dev before dev is being null
> checked.
> 
> Addresses-Coverity: ("Dereference before null check")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH][V2] net: dsa: b53: remove redundant null check on dev
  2021-06-15  9:05 [PATCH][V2] net: dsa: b53: remove redundant null check on dev Colin King
  2021-06-15 14:10 ` Florian Fainelli
@ 2021-06-15 18:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-15 18:30 UTC (permalink / raw)
  To: Colin King
  Cc: f.fainelli, andrew, vivien.didelot, olteanv, davem, kuba, netdev,
	kernel-janitors, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 15 Jun 2021 10:05:16 +0100 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer dev can never be null, the null check is redundant
> and can be removed. Cleans up a static analysis warning that
> pointer priv is dereferencing dev before dev is being null
> checked.
> 
> [...]

Here is the summary with links:
  - [V2] net: dsa: b53: remove redundant null check on dev
    https://git.kernel.org/netdev/net-next/c/11b57faf951c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-06-15 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  9:05 [PATCH][V2] net: dsa: b53: remove redundant null check on dev Colin King
2021-06-15 14:10 ` Florian Fainelli
2021-06-15 18:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).