net: hp100: fix always-true check for link up state
authorColin Ian King <colin.king@canonical.com>
Fri, 14 Sep 2018 16:39:53 +0000 (17:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Sep 2018 10:06:00 +0000 (03:06 -0700)
commitc0f2c063abc8a9ce8e116ad4236686234c709e9f
tree9f0120a26fc49ad437a9d1ab06e1128fa53350cf
parent9951e17efd05b8ad49bbc0db2e6b483f95d94d86
net: hp100: fix always-true check for link up state

[ Upstream commit a7f38002fb69b44f8fc622ecb838665d0b8666af ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hp/hp100.c