summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-05-02 14:04:19 -0700
committerJakub Kicinski <kuba@kernel.org>2022-05-02 14:04:20 -0700
commite1ff0bd673505727e0d7fc062f4d6745ec8ca8bb (patch)
tree64cf0210b38b34e2522cda87b23af36c3cf8a07a
parentc5f50500a0270ee1618373baa85a0bac9a0dc4bf (diff)
parent8c5b07da9bc8c056a3ddca00b4e268358f643343 (diff)
Merge branch 'ocelot-stats-improvement'
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>
-rw-r--r--include/soc/mscc/ocelot.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 5c4f57cfa785..8d8d46778f7e 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -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 {
@@ -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;