Skip to contentSkip to conversation

can: softing: remove redundant NULL check

PATCH In review Daniil Dulov 3 participants 6 messages Feb 11, 2024 – Feb 20, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: softing: remove redundant NULL check

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 03fd3cf5a179 ("can: add driver for Softing card")
---
 drivers/net/can/softing/softing_fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/softing/softing_fw.c +1 -1
index bad69a4abec1..5a3f9e4b0b62 100644
@@ -436,7 +436,7 @@ int softing_startstop(struct net_device *dev, int up)
 		return ret;
 
 	bus_bitmask_start = 0;
-	if (dev && up)
+	if (up)
 		/* prepare to start this bus as well */
 		bus_bitmask_start |= (1 << priv->index);
 	/* bring netdevs down */
Signature · 1 line
2.25.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Daniil Dulov

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 03fd3cf5a179 ("can: add driver for Softing card")

Hi Daniil,

I am not sure that dev cannot be NULL.
But I do see that the code assumes it is not, and would crash if it is. So I think that, functionally, your statement is correct.

	priv = netdev_priv(dev);
	card = priv->card;
#2 lore raw

Hi Simon,

I have a general question on the "Fixes:" tag in this patch:

Quoted 6 lines · Simon Horman
Quoted 5 lines · Daniil Dulov

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 03fd3cf5a179 ("can: add driver for Softing card")

IMHO this is simply an improvement which is done by all patches applied to the kernel but it does not really "fix" anything from a functional standpoint.

Shouldn't we either invent a new tag or better leave it out to not confuse the stable maintainers?

Best regards,
Oliver

Quoted 13 lines
Quoted 1 line

Hi Daniil,

I am not sure that dev cannot be NULL.
But I do see that the code assumes it is not, and would crash if it is. So I think that, functionally, your statement is correct.

	priv = netdev_priv(dev);
	card = priv->card;
reviewer
#3 lore raw
Quoted 10 lines · Oliver Hartkopp

Hi Simon,

I have a general question on the "Fixes:" tag in this patch:

Quoted 5 lines · Simon Horman
Quoted 4 lines · Daniil Dulov

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Fixes 03fd3cf5a179 ("can: add driver for Softing card")

IMHO this is simply an improvement which is done by all patches applied to the kernel but it does not really "fix" anything from a functional standpoint.

Shouldn't we either invent a new tag or better leave it out to not confuse the stable maintainers?

Hi Oliver,

sorry for missing that in my review.

Yes, I agree that this is probably not a fix, for which my rule of thumb is something that addresses a user-visible problem. So I agree it should not have a fixes tag.

I would suggest that we can just change the text to something that has no tag. Something like:

...

Introduced by 03fd3cf5a179 ("can: add driver for Softing card")

Signed-of-by: ...

Quoted 18 lines

Best regards,
Oliver

Quoted 13 lines
Quoted 1 line

Hi Daniil,

I am not sure that dev cannot be NULL.
But I do see that the code assumes it is not, and would crash if it is. So I think that, functionally, your statement is correct.

	priv = netdev_priv(dev);
	card = priv->card;
#4 lore raw

Hi Simon,

Quoted 28 lines · Simon Horman
Quoted 10 lines · Oliver Hartkopp

Hi Simon,

I have a general question on the "Fixes:" tag in this patch:

Quoted 5 lines · Simon Horman
Quoted 4 lines · Daniil Dulov

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Fixes 03fd3cf5a179 ("can: add driver for Softing card")

IMHO this is simply an improvement which is done by all patches applied to the kernel but it does not really "fix" anything from a functional standpoint.

Shouldn't we either invent a new tag or better leave it out to not confuse the stable maintainers?

Hi Oliver,

sorry for missing that in my review.

Yes, I agree that this is probably not a fix, for which my rule of thumb is something that addresses a user-visible problem. So I agree it should not have a fixes tag.

Quoted 7 lines

I would suggest that we can just change the text to something that has no tag. Something like:

...

Introduced by 03fd3cf5a179 ("can: add driver for Softing card")

Yes, but the "Introduced-by:" tag would be an optional tag for people that like blaming others, right?

IMHO we should think about completely removing the "Fixes:" tag, when it has no user-visible effect that might be a candidate for stable kernels. It is common improvement work. And it has been so for years.

Best regards,
Oliver

reviewer
#5 lore raw
Quoted 34 lines · Oliver Hartkopp

Hi Simon,

Quoted 31 lines · Simon Horman
Quoted 10 lines · Oliver Hartkopp

Hi Simon,

I have a general question on the "Fixes:" tag in this patch:

Quoted 5 lines · Simon Horman
Quoted 4 lines · Daniil Dulov

In this case dev cannot be NULL, so remove redundant check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Fixes 03fd3cf5a179 ("can: add driver for Softing card")

IMHO this is simply an improvement which is done by all patches applied to the kernel but it does not really "fix" anything from a functional standpoint.

Shouldn't we either invent a new tag or better leave it out to not confuse the stable maintainers?

Hi Oliver,

sorry for missing that in my review.

Yes, I agree that this is probably not a fix, for which my rule of thumb is something that addresses a user-visible problem. So I agree it should not have a fixes tag.

I would suggest that we can just change the text to something that has no tag. Something like:

Quoted 7 lines
Quoted 4 lines

...

Introduced by 03fd3cf5a179 ("can: add driver for Softing card")

Yes, but the "Introduced-by:" tag would be an optional tag for people that like blaming others, right?

Yes, That does seem useful to me.

Quoted 3 lines

IMHO we should think about completely removing the "Fixes:" tag, when it has no user-visible effect that might be a candidate for stable kernels. It is common improvement work. And it has been so for years.

Likewise, that does sound like a good idea to me.