As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
---
drivers/net/ethernet/broadcom/tg3.c | 26 ++------------------------
1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c
b/drivers/net/ethernet/broadcom/tg3.c
index 04964bbe08cf..400451e10f77 100644
From: Michael Chan <michael.chan@broadcom.com> Date: 2024-03-07 22:38:16
On Thu, Mar 7, 2024 at 11:23 AM Nikita Kiryushin [off-list ref] wrote:
As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
The patch looks good to me. But I think we can go one step further
and change tg3_power_down_prepare() to a void function. Thanks.
As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification and change
tg3_power_down_prepare to a void function as its result is no more checked.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
---
v2: Change tg3_power_down_prepare() to a void function
as Michael Chan [off-list ref] suggested.
drivers/net/ethernet/broadcom/tg3.c | 30 ++++-------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c
b/drivers/net/ethernet/broadcom/tg3.c
index 04964bbe08cf..bc36926a57cf 100644
From: Michael Chan <michael.chan@broadcom.com> Date: 2024-03-11 17:22:44
On Mon, Mar 11, 2024 at 8:45 AM Nikita Kiryushin [off-list ref] wrote:
As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification and change
tg3_power_down_prepare to a void function as its result is no more checked.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
---
v2: Change tg3_power_down_prepare() to a void function
as Michael Chan [off-list ref] suggested.
drivers/net/ethernet/broadcom/tg3.c | 30 ++++-------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
The patch looks good to me. But this cleanup patch should be for
net-next and net-next is closed right now.
Please re-post in about 2 weeks. You can add my tag when you repost:
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Thanks.
As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification and change
tg3_power_down_prepare to a void function as its result is no more checked.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
---
v2: Change tg3_power_down_prepare() to a void function
as Michael Chan [off-list ref] suggested.
drivers/net/ethernet/broadcom/tg3.c | 30 ++++-------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
On 2024-03-27 at 00:05:44, Nikita Kiryushin (kiryushin@ancud.ru) wrote:
quoted hunk
As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.
Remove (now unreachable) code for simplification and change
tg3_power_down_prepare to a void function as its result is no more checked.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <redacted>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
---
v2: Change tg3_power_down_prepare() to a void function
as Michael Chan [off-list ref] suggested.
drivers/net/ethernet/broadcom/tg3.c | 30 ++++-------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
From: Michael Chan <michael.chan@broadcom.com>
Sent: Wednesday, March 27, 2024 10:39 AM
To: Jakub Kicinski <kuba@kernel.org>
Cc: Ratheesh Kannoth <rkannoth@marvell.com>; Nikita Kiryushin
[off-list ref]; Michael Chan [off-list ref]; Pavan
Chebbi [off-list ref]; David S. Miller
[off-list ref]; Eric Dumazet [off-list ref]; Paolo
Abeni [off-list ref]; Rafael J. Wysocki [off-list ref];
netdev@vger.kernel.org; linux-kernel@vger.kernel.org; lvc-
project@linuxtesting.org
Subject: [EXTERNAL] Re: [PATCH net-next v2] tg3: Remove residual error
handling in tg3_suspend
Prioritize security for external emails: Confirm sender and content safety
before clicking links or opening attachments
----------------------------------------------------------------------
On Tue, Mar 26, 2024 at 8:24 PM Jakub Kicinski [off-list ref] wrote:
quoted
On Wed, 27 Mar 2024 08:14:30 +0530 Ratheesh Kannoth wrote:
quoted
quoted
@@ -18090,7 +18090,6 @@ static int tg3_suspend(struct device
*device)
quoted
quoted
quoted
{
Please address Michael Chan's comment to make this function return type
to "void"
quoted
quoted
instead of "int"
It's used as a callback in SIMPLE_DEV_PM_OPS(), how would that work?
Please stop adding these lines, they are unless.
If you want to attribute the work to some project / employer
add (SVACE) to your author lines.
Tool used signature line (the SVACE one) in that format was put in the
patch as required by lvc-project protocols. I guess, it is used for some
automation by the project, but I can agree, that the needs of some
specific project should not add cruft to the general code base/version control.
Thank you for expressing annoyance about it, I hope it will trigger conversation
about better way of adding the needed information for further iterations of the
project (as this thread is being mirrored to the project mailing list).
How is deleting dead code a fix?
Originally, that was intended as a fix of a potential problematic case, that
tg3_power_down_prepare() could change in the future, returning a
non-zero status (which would make the removed code not dead, but undead).
But than, as patch evolved, it became a straight up dead code removal.
Probably, I should have removed the "fixes" line at that point, but
I think it still useful as a reference point to know, after which commit this patch
becomes relevant (to know, if it should be back-ported to some version or not,
for example).As I guess from the guide, patches "Fixes:" tag has some special treatment in the development cycle, but what would be more appropriate in that case?
Hopefully you can find in there whether we suggest posting new versions
in reply to the old ones..
Thank you for pointing this out! Missed the part about "The new version of
patches should be posted as a separate thread, not as a reply to the
previous posting. Change log should include a link to the previous posting"
while reading netdev guide.
Should I resubmit the patch in the separate thread now? If so, should I
make any changes to it (as discussed)? Would it bump the patch version
(the patch would essentially be the same, as only some metadata like
change log itself would change)?
From: Jakub Kicinski <kuba@kernel.org> Date: 2024-03-29 15:25:41
On Fri, 29 Mar 2024 14:51:18 +0300 Nikita Kiryushin wrote:
quoted
How is deleting dead code a fix?
Originally, that was intended as a fix of a potential problematic case, that
tg3_power_down_prepare() could change in the future, returning a
non-zero status (which would make the removed code not dead, but undead).
But than, as patch evolved, it became a straight up dead code removal.
Probably, I should have removed the "fixes" line at that point, but
I think it still useful as a reference point to know, after which commit this patch
becomes relevant (to know, if it should be back-ported to some version or not,
for example).As I guess from the guide, patches "Fixes:" tag has some special treatment in the development cycle, but what would be more appropriate in that case?
You can quote the commit where code became irrelevant by saying
something like:
This came became unreachable in commit c866b7eac073 ("tg3: Do not use
legacy PCI power management").
Fixes tag are often used to indicate that something is a bug fix.
Backporters are unlikely to care about this particular change,
let's not waste their time.