提交 efcd549d 编写于 作者: C Colin Ian King 提交者: David S. Miller

net: phy: bcm54140: fix less than zero comparison on an unsigned

Currently the unsigned variable tmp is being checked for an negative
error return from the call to bcm_phy_read_rdb and this can never
be true since tmp is unsigned.  Fix this by making tmp a plain int.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 4406d36d ("net: phy: bcm54140: add hwmon support")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NMichael Walle <michael@walle.cc>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8ffe2df6
......@@ -191,7 +191,8 @@ static int bcm54140_hwmon_read_alarm(struct device *dev, unsigned int bit,
static int bcm54140_hwmon_read_temp(struct device *dev, u32 attr, long *val)
{
struct phy_device *phydev = dev_get_drvdata(dev);
u16 reg, tmp;
u16 reg;
int tmp;
switch (attr) {
case hwmon_temp_input:
......@@ -224,7 +225,8 @@ static int bcm54140_hwmon_read_in(struct device *dev, u32 attr,
int channel, long *val)
{
struct phy_device *phydev = dev_get_drvdata(dev);
u16 bit, reg, tmp;
u16 bit, reg;
int tmp;
switch (attr) {
case hwmon_in_input:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册