[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240327024430.GA1370891@maili.marvell.com>
Date: Wed, 27 Mar 2024 08:14:30 +0530
From: Ratheesh Kannoth <rkannoth@...vell.com>
To: Nikita Kiryushin <kiryushin@...ud.ru>
CC: Michael Chan <mchan@...adcom.com>,
Pavan Chebbi
<pavan.chebbi@...adcom.com>,
"David S. Miller" <davem@...emloft.net>,
Eric
Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni
<pabeni@...hat.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>,
Michael Chan <michael.chan@...adcom.com>
Subject: Re: [PATCH net-next v2] tg3: Remove residual error handling in
tg3_suspend
On 2024-03-27 at 00:05:44, Nikita Kiryushin (kiryushin@...ud.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@...ud.ru>
> Reviewed-by: Michael Chan <michael.chan@...adcom.com>
> ---
> v2: Change tg3_power_down_prepare() to a void function
> as Michael Chan <michael.chan@...adcom.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"
>
Powered by blists - more mailing lists