Message ID | 20171103133013.70104-4-chris.brandt@renesas.com |
---|---|
State | Accepted |
Commit | 33bab1045773dea9f1bac24569a7f4e29072fd20 |
Delegated to: | Joe Hershberger |
Headers | show |
Series | net: update Ethernet for Renesas RZ/A1 | expand |
Hi, 2017-11-03 22:30 GMT+09:00 Chris Brandt <chris.brandt@renesas.com>: > Since the return value is a signed int, if the leading MSB of rdreg is a 1, > it will get signed extended and will return a negative value which is an > error even though we read the correct value. > > Fixes: dfcc496ed7e2 ("net: mii: Changes not made by spatch") > Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Best regards, Nobuhiro > --- > drivers/net/phy/miiphybb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c > index af676b9bae..d61722490e 100644 > --- a/drivers/net/phy/miiphybb.c > +++ b/drivers/net/phy/miiphybb.c > @@ -232,7 +232,7 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, char read, > */ > int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg) > { > - short rdreg; /* register working value */ > + unsigned short rdreg; /* register working value */ > int v; > int j; /* counter */ > struct bb_miiphy_bus *bus; > -- > 2.14.1 > > > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot
On Fri, Nov 3, 2017 at 8:30 AM, Chris Brandt <chris.brandt@renesas.com> wrote: > Since the return value is a signed int, if the leading MSB of rdreg is a 1, > it will get signed extended and will return a negative value which is an > error even though we read the correct value. > > Fixes: dfcc496ed7e2 ("net: mii: Changes not made by spatch") > Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Hi Chris, https://patchwork.ozlabs.org/patch/833922/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git Thanks! -Joe
diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c index af676b9bae..d61722490e 100644 --- a/drivers/net/phy/miiphybb.c +++ b/drivers/net/phy/miiphybb.c @@ -232,7 +232,7 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, char read, */ int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg) { - short rdreg; /* register working value */ + unsigned short rdreg; /* register working value */ int v; int j; /* counter */ struct bb_miiphy_bus *bus;
Since the return value is a signed int, if the leading MSB of rdreg is a 1, it will get signed extended and will return a negative value which is an error even though we read the correct value. Fixes: dfcc496ed7e2 ("net: mii: Changes not made by spatch") Signed-off-by: Chris Brandt <chris.brandt@renesas.com> --- drivers/net/phy/miiphybb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)