diff options
author | Chris Brandt <chris.brandt@renesas.com> | 2017-11-03 08:30:13 -0500 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-01-15 12:05:17 -0600 |
commit | 33bab1045773dea9f1bac24569a7f4e29072fd20 (patch) | |
tree | f9ddd9ca62460d8200395d1af2ee19abf4e4edc9 | |
parent | f6ac626c8a54fc4062e4be68274dda187e103245 (diff) |
net: miiphybb: fix casting error
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>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r-- | drivers/net/phy/miiphybb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c index af676b9baee..d61722490ea 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; |