* [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write
@ 2018-12-26 18:21 Kangjie Lu
2018-12-26 19:13 ` Heiner Kallweit
0 siblings, 1 reply; 4+ messages in thread
From: Kangjie Lu @ 2018-12-26 18:21 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Andrew Lunn, Vivien Didelot, Florian Fainelli,
David S. Miller, netdev, linux-kernel
Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
return their error codes upstream.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
drivers/net/dsa/bcm_sf2.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 2eb68769562c..236815700fba 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -303,11 +303,10 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
* send them to our master MDIO bus controller
*/
if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
- bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
+ return bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
else
- mdiobus_write_nested(priv->master_mii_bus, addr, regnum, val);
-
- return 0;
+ return mdiobus_write_nested(priv->master_mii_bus,
+ addr, regnum, val);
}
static irqreturn_t bcm_sf2_switch_0_isr(int irq, void *dev_id)
--
2.17.2 (Apple Git-113)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write
2018-12-26 18:21 [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write Kangjie Lu
@ 2018-12-26 19:13 ` Heiner Kallweit
[not found] ` <CAK8KejrSvuFF546cSTwN_XWD6N8FxbSCjxCUsqaQ_N6S8nTA5A@mail.gmail.com>
2018-12-26 20:34 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2018-12-26 19:13 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, Andrew Lunn, Vivien Didelot, Florian Fainelli,
David S. Miller, netdev, linux-kernel
On 26.12.2018 19:21, Kangjie Lu wrote:
> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
> return their error codes upstream.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/net/dsa/bcm_sf2.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> index 2eb68769562c..236815700fba 100644
> --- a/drivers/net/dsa/bcm_sf2.c
> +++ b/drivers/net/dsa/bcm_sf2.c
> @@ -303,11 +303,10 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
> * send them to our master MDIO bus controller
> */
> if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
> - bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
> + return bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
This is wrong. Please get familiar with what the function does.
And test changes before submitting them!
> else
> - mdiobus_write_nested(priv->master_mii_bus, addr, regnum, val);
> -
> - return 0;
> + return mdiobus_write_nested(priv->master_mii_bus,
> + addr, regnum, val);
> }
>
> static irqreturn_t bcm_sf2_switch_0_isr(int irq, void *dev_id)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write
[not found] ` <CAK8KejrSvuFF546cSTwN_XWD6N8FxbSCjxCUsqaQ_N6S8nTA5A@mail.gmail.com>
@ 2018-12-26 19:41 ` Heiner Kallweit
0 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2018-12-26 19:41 UTC (permalink / raw)
To: Kangjie Lu
Cc: Aditya Pakki, Andrew Lunn, Vivien Didelot, Florian Fainelli,
David S. Miller, netdev, open list
On 26.12.2018 20:32, Kangjie Lu wrote:
>
>
> On Wed, Dec 26, 2018 at 1:13 PM Heiner Kallweit <hkallweit1@gmail.com <mailto:hkallweit1@gmail.com>> wrote:
>
> On 26.12.2018 19:21, Kangjie Lu wrote:
> > Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
> > return their error codes upstream.
> >
> > Signed-off-by: Kangjie Lu <kjlu@umn.edu <mailto:kjlu@umn.edu>>
> > ---
> > drivers/net/dsa/bcm_sf2.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> > index 2eb68769562c..236815700fba 100644
> > --- a/drivers/net/dsa/bcm_sf2.c
> > +++ b/drivers/net/dsa/bcm_sf2.c
> > @@ -303,11 +303,10 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
> > * send them to our master MDIO bus controller
> > */
> > if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
> > - bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
> > + return bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
> This is wrong. Please get familiar with what the function does.
> And test changes before submitting them!
>
>
> bcm_sf2_sw_indir_rw() doesn't return an error code, so we don't propagate its return value but return 0 after it.
>
> For mdiobus_write_nested(), since it does return an error code, we propagate its error code upstream.
>
> Does this sound right to you?
>
Better. You should test a change before submitting (and better not only compile-test).
And please no HTML mails. Get familiar with the basics of kernel development
before submitting. Read document "SubmittingPatches" and the following for netdev:
https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt
By the way: net-next is closed currently.
>
>
> > else
> > - mdiobus_write_nested(priv->master_mii_bus, addr, regnum, val);
> > -
> > - return 0;
> > + return mdiobus_write_nested(priv->master_mii_bus,
> > + addr, regnum, val);
> > }
> >
> > static irqreturn_t bcm_sf2_switch_0_isr(int irq, void *dev_id)
> >
>
>
>
> --
> Kangjie Lu
> Assistant Professor
> Department of Computer Science and Engineering
> University of Minnesota
> Personal homepage <https://www-users.cs.umn.edu/~kjlu>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write
2018-12-26 19:13 ` Heiner Kallweit
[not found] ` <CAK8KejrSvuFF546cSTwN_XWD6N8FxbSCjxCUsqaQ_N6S8nTA5A@mail.gmail.com>
@ 2018-12-26 20:34 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-12-26 20:34 UTC (permalink / raw)
To: hkallweit1
Cc: kjlu, pakki001, andrew, vivien.didelot, f.fainelli, netdev,
linux-kernel
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 26 Dec 2018 20:13:15 +0100
> On 26.12.2018 19:21, Kangjie Lu wrote:
>> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
>> return their error codes upstream.
>>
>> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
>> ---
>> drivers/net/dsa/bcm_sf2.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
>> index 2eb68769562c..236815700fba 100644
>> --- a/drivers/net/dsa/bcm_sf2.c
>> +++ b/drivers/net/dsa/bcm_sf2.c
>> @@ -303,11 +303,10 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
>> * send them to our master MDIO bus controller
>> */
>> if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
>> - bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
>> + return bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
> This is wrong. Please get familiar with what the function does.
> And test changes before submitting them!
This is getting rediculous.
You are making completely untested changes, resubmitting very quickly
without any care or consideration whatsoever, and wasting a lot of
developer time with your carelessness.
Please stop doing this.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-26 20:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26 18:21 [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write Kangjie Lu
2018-12-26 19:13 ` Heiner Kallweit
[not found] ` <CAK8KejrSvuFF546cSTwN_XWD6N8FxbSCjxCUsqaQ_N6S8nTA5A@mail.gmail.com>
2018-12-26 19:41 ` Heiner Kallweit
2018-12-26 20:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox