lkml.org 
[lkml]   [2023]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next 7/8] net: mscc: ocelot: strengthen type of "int i" in ocelot_stats.c
From


On 4/12/2023 5:47 AM, Vladimir Oltean wrote:
> 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: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/ethernet/mscc/ocelot_stats.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>

For the lazy readers who didn't dig up the source outside the patch
context, the WARN in question is:

>
> /* enum ocelot_stat must be kept sorted in the same
> * order as layout[i].reg in order to have efficient
> * bulking
> */
> WARN_ON(last >= layout[i].reg);

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

\
 
 \ /
  Last update: 2023-04-12 23:22    [W:0.467 / U:25.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site