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:07:33 +0000 (03:07 -0700)
commit43e575023f1acb71dcf02ce5e67ca4451fff3cdd
tree6ba23ad7877db9512fbb189c696774846e2c5672
parent11f734283a987ac26365aefafdd012a3f37e05a3
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