Commit 6663c01e authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: mscc: ocelot: strengthen type of "int i" in ocelot_stats.c

The "int i" used to index the struct ocelot_stat_layout array actually
has a specific type: enum ocelot_stat. Use it, so that the WARN()
comment from ocelot_prepare_stats_regions() makes more sense.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent eae0b9d1
...@@ -395,7 +395,7 @@ static void ocelot_check_stats_work(struct work_struct *work) ...@@ -395,7 +395,7 @@ static void ocelot_check_stats_work(struct work_struct *work)
void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data) void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data)
{ {
const struct ocelot_stat_layout *layout; const struct ocelot_stat_layout *layout;
int i; enum ocelot_stat i;
if (sset != ETH_SS_STATS) if (sset != ETH_SS_STATS)
return; return;
...@@ -442,7 +442,8 @@ static void ocelot_port_stats_run(struct ocelot *ocelot, int port, void *priv, ...@@ -442,7 +442,8 @@ static void ocelot_port_stats_run(struct ocelot *ocelot, int port, void *priv,
int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset) int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset)
{ {
const struct ocelot_stat_layout *layout; const struct ocelot_stat_layout *layout;
int i, num_stats = 0; enum ocelot_stat i;
int num_stats = 0;
if (sset != ETH_SS_STATS) if (sset != ETH_SS_STATS)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -461,8 +462,8 @@ static void ocelot_port_ethtool_stats_cb(struct ocelot *ocelot, int port, ...@@ -461,8 +462,8 @@ static void ocelot_port_ethtool_stats_cb(struct ocelot *ocelot, int port,
void *priv) void *priv)
{ {
const struct ocelot_stat_layout *layout; const struct ocelot_stat_layout *layout;
enum ocelot_stat i;
u64 *data = priv; u64 *data = priv;
int i;
layout = ocelot_get_stats_layout(ocelot); layout = ocelot_get_stats_layout(ocelot);
...@@ -890,7 +891,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) ...@@ -890,7 +891,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
struct ocelot_stats_region *region = NULL; struct ocelot_stats_region *region = NULL;
const struct ocelot_stat_layout *layout; const struct ocelot_stat_layout *layout;
enum ocelot_reg last = 0; enum ocelot_reg last = 0;
int i; enum ocelot_stat i;
INIT_LIST_HEAD(&ocelot->stats_regions); INIT_LIST_HEAD(&ocelot->stats_regions);
......
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