summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hp/hp100.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-09-14 17:39:53 +0100
committerDavid S. Miller <davem@davemloft.net>2018-09-17 07:55:19 -0700
commita7f38002fb69b44f8fc622ecb838665d0b8666af (patch)
tree268980605e8b77fcc841c6797bf7c3af49e7a7f3 /drivers/net/ethernet/hp/hp100.c
parent321cc359d899a8e988f3725d87c18a628e1cc624 (diff)
downloadop-kernel-dev-a7f38002fb69b44f8fc622ecb838665d0b8666af.zip
op-kernel-dev-a7f38002fb69b44f8fc622ecb838665d0b8666af.tar.gz
net: hp100: fix always-true check for link up state
The operation ~(p100_inb(VG_LAN_CFG_1) & HP100_LINK_UP) returns a value that is always non-zero and hence the wait for the link to drop always terminates prematurely. Fix this by using a logical not operator instead of a bitwise complement. This issue has been in the driver since pre-2.6.12-rc2. Detected by CoverityScan, CID#114157 ("Logical vs. bitwise operator") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hp/hp100.c')
-rw-r--r--drivers/net/ethernet/hp/hp100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index c8c7ad2..9b5a68b 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -2634,7 +2634,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
/* Wait for link to drop */
time = jiffies + (HZ / 10);
do {
- if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
+ if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
break;
if (!in_interrupt())
schedule_timeout_interruptible(1);
OpenPOWER on IntegriCloud