Skip to content

Commit

Permalink
net: mscc: ocelot: remove unnecessary variable
Browse files Browse the repository at this point in the history
Commit 2f187bf ("net: ethernet: ocelot: remove the need for num_stats
initializer") added a flags field to the ocelot stats structure. The same
behavior can be achieved without this additional field taking up extra
memory.

Remove this structure element to free up RAM

Suggested-by: Vladimir Oltean <[email protected]>
Signed-off-by: Colin Foster <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
colin-foster-in-advantage authored and kuba-moo committed May 2, 2022
1 parent c5f5050 commit 05e4ed1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 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); \
((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 05e4ed1

Please sign in to comment.