net: atlantic: use U32_MAX in aq_hw_utils.c
authorMark Starovoytov <mstarovoitov@marvell.com>
Mon, 20 Jul 2020 18:32:41 +0000 (21:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 01:07:38 +0000 (18:07 -0700)
This patch replaces magic constant ~0U usage with U32_MAX in aq_hw_utils.c

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.c

index ae85c0a7d238522fd6c7fe51054d23871162500f..1921741f7311daaef2592bf4bdbc9725d42b2b04 100644 (file)
@@ -41,9 +41,8 @@ u32 aq_hw_read_reg(struct aq_hw_s *hw, u32 reg)
 {
        u32 value = readl(hw->mmio + reg);
 
-       if ((~0U) == value &&
-           (~0U) == readl(hw->mmio +
-                          hw->aq_nic_cfg->aq_hw_caps->hw_alive_check_addr))
+       if (value == U32_MAX &&
+           readl(hw->mmio + hw->aq_nic_cfg->aq_hw_caps->hw_alive_check_addr) == U32_MAX)
                aq_utils_obj_set(&hw->flags, AQ_HW_FLAG_ERR_UNPLUG);
 
        return value;