* [PATCH v1 net-next 0/2] ocelot stats improvement
@ 2022-04-30 23:23 Colin Foster
2022-04-30 23:23 ` [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable Colin Foster
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Colin Foster @ 2022-04-30 23:23 UTC (permalink / raw)
To: linux-kernel, netdev
Cc: David S. Miller, UNGLinuxDriver, Alexandre Belloni,
Claudiu Manoil, Vladimir Oltean
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.
Colin Foster (2):
net: mscc: ocelot: remove unnecessary variable
net: mscc: ocelot: add missed parentheses around macro argument
include/soc/mscc/ocelot.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable
2022-04-30 23:23 [PATCH v1 net-next 0/2] ocelot stats improvement Colin Foster
@ 2022-04-30 23:23 ` Colin Foster
2022-05-01 11:08 ` Vladimir Oltean
2022-04-30 23:23 ` [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument Colin Foster
2022-05-02 21:20 ` [PATCH v1 net-next 0/2] ocelot stats improvement patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Colin Foster @ 2022-04-30 23:23 UTC (permalink / raw)
To: linux-kernel, netdev
Cc: David S. Miller, UNGLinuxDriver, Alexandre Belloni,
Claudiu Manoil, Vladimir Oltean
Commit 2f187bfa6f35 ("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 <vladimir.oltean@nxp.com>
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
include/soc/mscc/ocelot.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 5c4f57cfa785..75739766244b 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); \
+ ((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;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument
2022-04-30 23:23 [PATCH v1 net-next 0/2] ocelot stats improvement Colin Foster
2022-04-30 23:23 ` [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable Colin Foster
@ 2022-04-30 23:23 ` Colin Foster
2022-05-01 11:08 ` Vladimir Oltean
2022-05-02 21:20 ` [PATCH v1 net-next 0/2] ocelot stats improvement patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Colin Foster @ 2022-04-30 23:23 UTC (permalink / raw)
To: linux-kernel, netdev
Cc: David S. Miller, UNGLinuxDriver, Alexandre Belloni,
Claudiu Manoil, Vladimir Oltean
Commit 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats
initializer") added a macro that patchwork warned it lacked parentheses
around an argument. Correct this mistake.
Fixes: 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer")
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
include/soc/mscc/ocelot.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 75739766244b..8d8d46778f7e 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -106,7 +106,7 @@
#define REG_RESERVED(reg) REG(reg, REG_RESERVED_ADDR)
#define for_each_stat(ocelot, stat) \
- for ((stat) = ocelot->stats_layout; \
+ for ((stat) = (ocelot)->stats_layout; \
((stat)->name[0] != '\0'); \
(stat)++)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable
2022-04-30 23:23 ` [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable Colin Foster
@ 2022-05-01 11:08 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2022-05-01 11:08 UTC (permalink / raw)
To: Colin Foster
Cc: linux-kernel, netdev, David S. Miller, UNGLinuxDriver,
Alexandre Belloni, Claudiu Manoil
On Sat, Apr 30, 2022 at 04:23:26PM -0700, Colin Foster wrote:
> Commit 2f187bfa6f35 ("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 <vladimir.oltean@nxp.com>
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument
2022-04-30 23:23 ` [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument Colin Foster
@ 2022-05-01 11:08 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2022-05-01 11:08 UTC (permalink / raw)
To: Colin Foster
Cc: linux-kernel, netdev, David S. Miller, UNGLinuxDriver,
Alexandre Belloni, Claudiu Manoil
On Sat, Apr 30, 2022 at 04:23:27PM -0700, Colin Foster wrote:
> Commit 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats
> initializer") added a macro that patchwork warned it lacked parentheses
> around an argument. Correct this mistake.
>
> Fixes: 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer")
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net-next 0/2] ocelot stats improvement
2022-04-30 23:23 [PATCH v1 net-next 0/2] ocelot stats improvement Colin Foster
2022-04-30 23:23 ` [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable Colin Foster
2022-04-30 23:23 ` [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument Colin Foster
@ 2022-05-02 21:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-02 21:20 UTC (permalink / raw)
To: Colin Foster
Cc: linux-kernel, netdev, davem, UNGLinuxDriver, alexandre.belloni,
claudiu.manoil, vladimir.oltean
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 30 Apr 2022 16:23:25 -0700 you wrote:
> 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.
>
> Colin Foster (2):
> net: mscc: ocelot: remove unnecessary variable
> net: mscc: ocelot: add missed parentheses around macro argument
>
> [...]
Here is the summary with links:
- [v1,net-next,1/2] net: mscc: ocelot: remove unnecessary variable
https://git.kernel.org/netdev/net-next/c/05e4ed1ce585
- [v1,net-next,2/2] net: mscc: ocelot: add missed parentheses around macro argument
https://git.kernel.org/netdev/net-next/c/8c5b07da9bc8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-05-02 21:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 23:23 [PATCH v1 net-next 0/2] ocelot stats improvement Colin Foster
2022-04-30 23:23 ` [PATCH v1 net-next 1/2] net: mscc: ocelot: remove unnecessary variable Colin Foster
2022-05-01 11:08 ` Vladimir Oltean
2022-04-30 23:23 ` [PATCH v1 net-next 2/2] net: mscc: ocelot: add missed parentheses around macro argument Colin Foster
2022-05-01 11:08 ` Vladimir Oltean
2022-05-02 21:20 ` [PATCH v1 net-next 0/2] ocelot stats improvement patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.