Commit 74dc1d46 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-dsa-b53-sf2-warn'

Andrew Lunn says:

====================
dsa: b53/sf2

Fixup most of the C=1 W=1 warnings in these drivers.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6c67b03b c226e271
......@@ -145,42 +145,52 @@ static int b53_spi_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
static int b53_spi_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 2);
__le16 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 2);
if (!ret)
*val = le16_to_cpu(*val);
*val = le16_to_cpu(value);
return ret;
}
static int b53_spi_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 4);
__le32 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 4);
if (!ret)
*val = le32_to_cpu(*val);
*val = le32_to_cpu(value);
return ret;
}
static int b53_spi_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val)
{
__le64 value;
int ret;
*val = 0;
ret = b53_spi_read(dev, page, reg, (u8 *)val, 6);
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 6);
if (!ret)
*val = le64_to_cpu(*val);
*val = le64_to_cpu(value);
return ret;
}
static int b53_spi_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 8);
__le64 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 8);
if (!ret)
*val = le64_to_cpu(*val);
*val = le64_to_cpu(value);
return ret;
}
......
......@@ -128,12 +128,12 @@ static inline unsigned int bcm_sf2_get_num_udf_slices(const u8 *layout)
return count;
}
static inline u32 udf_upper_bits(unsigned int num_udf)
static inline u32 udf_upper_bits(int num_udf)
{
return GENMASK(num_udf - 1, 0) >> (UDFS_PER_SLICE - 1);
}
static inline u32 udf_lower_bits(unsigned int num_udf)
static inline u32 udf_lower_bits(int num_udf)
{
return (u8)GENMASK(num_udf - 1, 0);
}
......@@ -348,8 +348,8 @@ static int bcm_sf2_cfp_ipv4_rule_set(struct bcm_sf2_priv *priv, int port,
unsigned int queue_num,
struct ethtool_rx_flow_spec *fs)
{
__be16 vlan_tci = 0, vlan_m_tci = htons(0xffff);
struct ethtool_rx_flow_spec_input input = {};
__be16 vlan_tci = 0 , vlan_m_tci = 0xffff;
const struct cfp_udf_layout *layout;
unsigned int slice_num, rule_index;
struct ethtool_rx_flow_rule *flow;
......@@ -629,8 +629,8 @@ static int bcm_sf2_cfp_ipv6_rule_set(struct bcm_sf2_priv *priv, int port,
unsigned int queue_num,
struct ethtool_rx_flow_spec *fs)
{
__be16 vlan_tci = 0, vlan_m_tci = htons(0xffff);
struct ethtool_rx_flow_spec_input input = {};
__be16 vlan_tci = 0, vlan_m_tci = 0xffff;
unsigned int slice_num, rule_index[2];
const struct cfp_udf_layout *layout;
struct ethtool_rx_flow_rule *flow;
......
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