public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Nikita Kiryushin <kiryushin@ancud.ru>
Cc: Michael Chan <mchan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org>,
	Michael Chan <michael.chan@broadcom.com>
Subject: Re: [PATCH net-next v2] tg3: Remove residual error handling in tg3_suspend
Date: Wed, 27 Mar 2024 08:14:30 +0530	[thread overview]
Message-ID: <20240327024430.GA1370891@maili.marvell.com> (raw)
In-Reply-To: <20240326183544.488242-1-kiryushin@ancud.ru>

On 2024-03-27 at 00:05:44, Nikita Kiryushin (kiryushin@ancud.ru) 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 <kiryushin@ancud.ru>
> Reviewed-by: Michael Chan <michael.chan@broadcom.com>
> ---
> v2: Change tg3_power_down_prepare() to a void function
> as Michael Chan <michael.chan@broadcom.com> 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
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -4019,7 +4019,7 @@ static int tg3_power_up(struct tg3 *tp)
>
>  static int tg3_setup_phy(struct tg3 *, bool);
>
> -static int tg3_power_down_prepare(struct tg3 *tp)
> +static void tg3_power_down_prepare(struct tg3 *tp)
>  {
>  	u32 misc_host_ctrl;
>  	bool device_should_wake, do_low_power;
> @@ -4263,7 +4263,7 @@ static int tg3_power_down_prepare(struct tg3 *tp)
>
>  	tg3_ape_driver_state_change(tp, RESET_KIND_SHUTDOWN);
>
> -	return 0;
> +	return;
>  }
>
>  static void tg3_power_down(struct tg3 *tp)
> @@ -18090,7 +18090,6 @@ static int tg3_suspend(struct device *device)
>  {
Please address Michael Chan's comment to make this function return type to "void"
instead of "int"

>

  reply	other threads:[~2024-03-27  2:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 19:23 [PATCH] tg3: Remove residual error handling in tg3_suspend Nikita Kiryushin
2024-03-07 22:38 ` Michael Chan
2024-03-11 15:45   ` [PATCH v2] " Nikita Kiryushin
2024-03-11 17:22     ` Michael Chan
2024-03-26 18:35       ` [PATCH net-next " Nikita Kiryushin
2024-03-27  2:44         ` Ratheesh Kannoth [this message]
2024-03-27  3:24           ` Jakub Kicinski
2024-03-27  5:09             ` Michael Chan
2024-03-27  5:13               ` [EXTERNAL] " Ratheesh Kannoth
2024-03-29  1:10         ` Jakub Kicinski
2024-03-29 11:51           ` Nikita Kiryushin
2024-03-29 15:25             ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327024430.GA1370891@maili.marvell.com \
    --to=rkannoth@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kiryushin@ancud.ru \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mchan@broadcom.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox