Skip to content

Commit

Permalink
Merge branch 'ocelot-stats-improvement'
Browse files Browse the repository at this point in the history
Colin Foster says:

====================
ocelot stats improvement

A couple of pick-ups after f187bfa6f35 ("net: ethernet: ocelot: remove
the need for num_stats initializer") - one addresses a warning
patchwork flagged about operator precedence when using macro arguments.
The other is a reduction of unnecessary memory allocation.
====================

Link: https://lore.kernel.org/r/20220430232327.4091825-1-colin.foster@in-advantage.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed May 2, 2022
2 parents c5f5050 + 8c5b07d commit e1ff0bd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/soc/mscc/ocelot.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@
#define REG_RESERVED_ADDR 0xffffffff
#define REG_RESERVED(reg) REG(reg, REG_RESERVED_ADDR)

#define OCELOT_STAT_FLAG_END BIT(0)

#define for_each_stat(ocelot, stat) \
for ((stat) = ocelot->stats_layout; \
!((stat)->flags & OCELOT_STAT_FLAG_END); \
for ((stat) = (ocelot)->stats_layout; \
((stat)->name[0] != '\0'); \
(stat)++)

enum ocelot_target {
Expand Down Expand Up @@ -542,11 +540,10 @@ enum ocelot_ptp_pins {

struct ocelot_stat_layout {
u32 offset;
u32 flags;
char name[ETH_GSTRING_LEN];
};

#define OCELOT_STAT_END { .flags = OCELOT_STAT_FLAG_END }
#define OCELOT_STAT_END { .name = "" }

struct ocelot_stats_region {
struct list_head node;
Expand Down

0 comments on commit e1ff0bd

Please sign in to comment.