* [PATCH] net: dsa: lan9303: fix variable 'res' set but not used
@ 2020-07-05 20:55 Andrew Lunn
2020-07-05 20:56 ` Florian Fainelli
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-07-05 20:55 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Florian Fainelli, Andrew Lunn, Egil Hjelmeland
Since lan9303_adjust_link() is a void function, there is no option to
return an error. So just remove the variable and lets any errors be
discarded.
Cc: Egil Hjelmeland <privat@egil-hjelmeland.no>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/lan9303-core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index cc17a44dd3a8..aa1142d6a9f5 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -1042,7 +1042,7 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port,
struct phy_device *phydev)
{
struct lan9303 *chip = ds->priv;
- int ctl, res;
+ int ctl;
if (!phy_is_pseudo_fixed_link(phydev))
return;
@@ -1063,15 +1063,14 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port,
else
ctl &= ~BMCR_FULLDPLX;
- res = lan9303_phy_write(ds, port, MII_BMCR, ctl);
+ lan9303_phy_write(ds, port, MII_BMCR, ctl);
if (port == chip->phy_addr_base) {
/* Virtual Phy: Remove Turbo 200Mbit mode */
lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &ctl);
ctl &= ~LAN9303_VIRT_SPECIAL_TURBO;
- res = regmap_write(chip->regmap,
- LAN9303_VIRT_SPECIAL_CTRL, ctl);
+ regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ctl);
}
}
--
2.27.0.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] net: dsa: lan9303: fix variable 'res' set but not used
2020-07-05 20:55 [PATCH] net: dsa: lan9303: fix variable 'res' set but not used Andrew Lunn
@ 2020-07-05 20:56 ` Florian Fainelli
2020-07-05 22:48 ` David Miller
2020-07-05 22:49 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-07-05 20:56 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, Egil Hjelmeland
On 7/5/2020 1:55 PM, Andrew Lunn wrote:
> Since lan9303_adjust_link() is a void function, there is no option to
> return an error. So just remove the variable and lets any errors be
> discarded.
>
> Cc: Egil Hjelmeland <privat@egil-hjelmeland.no>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: dsa: lan9303: fix variable 'res' set but not used
2020-07-05 20:55 [PATCH] net: dsa: lan9303: fix variable 'res' set but not used Andrew Lunn
2020-07-05 20:56 ` Florian Fainelli
@ 2020-07-05 22:48 ` David Miller
2020-07-05 22:49 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-07-05 22:48 UTC (permalink / raw)
To: andrew; +Cc: netdev, f.fainelli, privat
From: Andrew Lunn <andrew@lunn.ch>
Date: Sun, 5 Jul 2020 22:55:55 +0200
> Since lan9303_adjust_link() is a void function, there is no option to
> return an error. So just remove the variable and lets any errors be
> discarded.
>
> Cc: Egil Hjelmeland <privat@egil-hjelmeland.no>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Applied to net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: dsa: lan9303: fix variable 'res' set but not used
2020-07-05 20:55 [PATCH] net: dsa: lan9303: fix variable 'res' set but not used Andrew Lunn
2020-07-05 20:56 ` Florian Fainelli
2020-07-05 22:48 ` David Miller
@ 2020-07-05 22:49 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-07-05 22:49 UTC (permalink / raw)
To: andrew; +Cc: netdev, f.fainelli, privat
From: Andrew Lunn <andrew@lunn.ch>
Date: Sun, 5 Jul 2020 22:55:55 +0200
> Since lan9303_adjust_link() is a void function, there is no option to
> return an error. So just remove the variable and lets any errors be
> discarded.
>
> Cc: Egil Hjelmeland <privat@egil-hjelmeland.no>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Applied to net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-05 22:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-05 20:55 [PATCH] net: dsa: lan9303: fix variable 'res' set but not used Andrew Lunn
2020-07-05 20:56 ` Florian Fainelli
2020-07-05 22:48 ` David Miller
2020-07-05 22:49 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox