Commit 6c3442f5 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by David S. Miller

drivers: net: replace UINT64_MAX with U64_MAX

U64_MAX is well defined now while the UINT64_MAX is not, so we fall
back to drivers' own definition as below:

	#ifndef UINT64_MAX
	#define UINT64_MAX             (u64)(~((u64)0))
	#endif

I believe this is in one phy driver then copied and pasted to other phy
drivers.

Replace the UINT64_MAX with U64_MAX to clean up the source code.
Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80e95f47
...@@ -665,13 +665,13 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip, ...@@ -665,13 +665,13 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
case STATS_TYPE_PORT: case STATS_TYPE_PORT:
err = mv88e6xxx_port_read(chip, port, s->reg, &reg); err = mv88e6xxx_port_read(chip, port, s->reg, &reg);
if (err) if (err)
return UINT64_MAX; return U64_MAX;
low = reg; low = reg;
if (s->size == 4) { if (s->size == 4) {
err = mv88e6xxx_port_read(chip, port, s->reg + 1, &reg); err = mv88e6xxx_port_read(chip, port, s->reg + 1, &reg);
if (err) if (err)
return UINT64_MAX; return U64_MAX;
high = reg; high = reg;
} }
break; break;
...@@ -685,7 +685,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip, ...@@ -685,7 +685,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
mv88e6xxx_g1_stats_read(chip, reg + 1, &high); mv88e6xxx_g1_stats_read(chip, reg + 1, &high);
break; break;
default: default:
return UINT64_MAX; return U64_MAX;
} }
value = (((u64)high) << 16) | low; value = (((u64)high) << 16) | low;
return value; return value;
......
...@@ -21,10 +21,6 @@ ...@@ -21,10 +21,6 @@
#include <linux/timecounter.h> #include <linux/timecounter.h>
#include <net/dsa.h> #include <net/dsa.h>
#ifndef UINT64_MAX
#define UINT64_MAX (u64)(~((u64)0))
#endif
#define SMI_CMD 0x00 #define SMI_CMD 0x00
#define SMI_CMD_BUSY BIT(15) #define SMI_CMD_BUSY BIT(15)
#define SMI_CMD_CLAUSE_22 BIT(12) #define SMI_CMD_CLAUSE_22 BIT(12)
......
...@@ -346,10 +346,6 @@ void bcm_phy_get_strings(struct phy_device *phydev, u8 *data) ...@@ -346,10 +346,6 @@ void bcm_phy_get_strings(struct phy_device *phydev, u8 *data)
} }
EXPORT_SYMBOL_GPL(bcm_phy_get_strings); EXPORT_SYMBOL_GPL(bcm_phy_get_strings);
#ifndef UINT64_MAX
#define UINT64_MAX (u64)(~((u64)0))
#endif
/* Caller is supposed to provide appropriate storage for the library code to /* Caller is supposed to provide appropriate storage for the library code to
* access the shadow copy * access the shadow copy
*/ */
...@@ -362,7 +358,7 @@ static u64 bcm_phy_get_stat(struct phy_device *phydev, u64 *shadow, ...@@ -362,7 +358,7 @@ static u64 bcm_phy_get_stat(struct phy_device *phydev, u64 *shadow,
val = phy_read(phydev, stat.reg); val = phy_read(phydev, stat.reg);
if (val < 0) { if (val < 0) {
ret = UINT64_MAX; ret = U64_MAX;
} else { } else {
val >>= stat.shift; val >>= stat.shift;
val = val & ((1 << stat.bits) - 1); val = val & ((1 << stat.bits) - 1);
......
...@@ -1482,9 +1482,6 @@ static void marvell_get_strings(struct phy_device *phydev, u8 *data) ...@@ -1482,9 +1482,6 @@ static void marvell_get_strings(struct phy_device *phydev, u8 *data)
} }
} }
#ifndef UINT64_MAX
#define UINT64_MAX (u64)(~((u64)0))
#endif
static u64 marvell_get_stat(struct phy_device *phydev, int i) static u64 marvell_get_stat(struct phy_device *phydev, int i)
{ {
struct marvell_hw_stat stat = marvell_hw_stats[i]; struct marvell_hw_stat stat = marvell_hw_stats[i];
...@@ -1494,7 +1491,7 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i) ...@@ -1494,7 +1491,7 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i)
val = phy_read_paged(phydev, stat.page, stat.reg); val = phy_read_paged(phydev, stat.page, stat.reg);
if (val < 0) { if (val < 0) {
ret = UINT64_MAX; ret = U64_MAX;
} else { } else {
val = val & ((1 << stat.bits) - 1); val = val & ((1 << stat.bits) - 1);
priv->stats[i] += val; priv->stats[i] += val;
......
...@@ -650,9 +650,6 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data) ...@@ -650,9 +650,6 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)
} }
} }
#ifndef UINT64_MAX
#define UINT64_MAX (u64)(~((u64)0))
#endif
static u64 kszphy_get_stat(struct phy_device *phydev, int i) static u64 kszphy_get_stat(struct phy_device *phydev, int i)
{ {
struct kszphy_hw_stat stat = kszphy_hw_stats[i]; struct kszphy_hw_stat stat = kszphy_hw_stats[i];
...@@ -662,7 +659,7 @@ static u64 kszphy_get_stat(struct phy_device *phydev, int i) ...@@ -662,7 +659,7 @@ static u64 kszphy_get_stat(struct phy_device *phydev, int i)
val = phy_read(phydev, stat.reg); val = phy_read(phydev, stat.reg);
if (val < 0) { if (val < 0) {
ret = UINT64_MAX; ret = U64_MAX;
} else { } else {
val = val & ((1 << stat.bits) - 1); val = val & ((1 << stat.bits) - 1);
priv->stats[i] += val; priv->stats[i] += val;
......
...@@ -168,9 +168,6 @@ static void smsc_get_strings(struct phy_device *phydev, u8 *data) ...@@ -168,9 +168,6 @@ static void smsc_get_strings(struct phy_device *phydev, u8 *data)
} }
} }
#ifndef UINT64_MAX
#define UINT64_MAX (u64)(~((u64)0))
#endif
static u64 smsc_get_stat(struct phy_device *phydev, int i) static u64 smsc_get_stat(struct phy_device *phydev, int i)
{ {
struct smsc_hw_stat stat = smsc_hw_stats[i]; struct smsc_hw_stat stat = smsc_hw_stats[i];
...@@ -179,7 +176,7 @@ static u64 smsc_get_stat(struct phy_device *phydev, int i) ...@@ -179,7 +176,7 @@ static u64 smsc_get_stat(struct phy_device *phydev, int i)
val = phy_read(phydev, stat.reg); val = phy_read(phydev, stat.reg);
if (val < 0) if (val < 0)
ret = UINT64_MAX; ret = U64_MAX;
else else
ret = val; ret = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment