* [PATCH] net: stmmac: Use str_enabled_disabled() helper
@ 2025-02-15 16:44 Yu-Chun Lin
2025-02-16 2:21 ` Huacai Chen
2025-02-16 10:33 ` Russell King (Oracle)
0 siblings, 2 replies; 3+ messages in thread
From: Yu-Chun Lin @ 2025-02-15 16:44 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
alexandre.torgue
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, jserv,
visitorckw, Yu-Chun Lin, kernel test robot
As kernel test robot reported, the following warning occurs:
cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8: opportunity for str_enabled_disabled(on)
Replace ternary (condition ? "enabled" : "disabled") with
str_enabled_disabled() from string_choices.h to improve readability,
maintain uniform string usage, and reduce binary size through linker
deduplication.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502111616.xnebdSv1-lkp@intel.com/
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index 96bcda0856ec..3efee70f46b3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/ethtool.h>
#include <linux/io.h>
+#include <linux/string_choices.h>
#include "stmmac.h"
#include "stmmac_pcs.h"
#include "stmmac_ptp.h"
@@ -633,7 +634,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
}
netdev_dbg(priv->dev, "Auxiliary Snapshot %s.\n",
- on ? "enabled" : "disabled");
+ str_enabled_disabled(on));
writel(tcr_val, ptpaddr + PTP_TCR);
/* wait for auxts fifo clear to finish */
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: stmmac: Use str_enabled_disabled() helper
2025-02-15 16:44 [PATCH] net: stmmac: Use str_enabled_disabled() helper Yu-Chun Lin
@ 2025-02-16 2:21 ` Huacai Chen
2025-02-16 10:33 ` Russell King (Oracle)
1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2025-02-16 2:21 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
alexandre.torgue, netdev, linux-stm32, linux-arm-kernel,
linux-kernel, jserv, visitorckw, kernel test robot
On Sun, Feb 16, 2025 at 12:44 AM Yu-Chun Lin <eleanor15x@gmail.com> wrote:
>
> As kernel test robot reported, the following warning occurs:
>
> cocci warnings: (new ones prefixed by >>)
> >> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8: opportunity for str_enabled_disabled(on)
>
> Replace ternary (condition ? "enabled" : "disabled") with
> str_enabled_disabled() from string_choices.h to improve readability,
> maintain uniform string usage, and reduce binary size through linker
> deduplication.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502111616.xnebdSv1-lkp@intel.com/
> Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> index 96bcda0856ec..3efee70f46b3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> @@ -16,6 +16,7 @@
> #include <linux/slab.h>
> #include <linux/ethtool.h>
> #include <linux/io.h>
> +#include <linux/string_choices.h>
> #include "stmmac.h"
> #include "stmmac_pcs.h"
> #include "stmmac_ptp.h"
> @@ -633,7 +634,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
> }
>
> netdev_dbg(priv->dev, "Auxiliary Snapshot %s.\n",
> - on ? "enabled" : "disabled");
> + str_enabled_disabled(on));
> writel(tcr_val, ptpaddr + PTP_TCR);
>
> /* wait for auxts fifo clear to finish */
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: stmmac: Use str_enabled_disabled() helper
2025-02-15 16:44 [PATCH] net: stmmac: Use str_enabled_disabled() helper Yu-Chun Lin
2025-02-16 2:21 ` Huacai Chen
@ 2025-02-16 10:33 ` Russell King (Oracle)
1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2025-02-16 10:33 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
alexandre.torgue, netdev, linux-stm32, linux-arm-kernel,
linux-kernel, jserv, visitorckw, kernel test robot
On Sun, Feb 16, 2025 at 12:44:12AM +0800, Yu-Chun Lin wrote:
> As kernel test robot reported, the following warning occurs:
>
> cocci warnings: (new ones prefixed by >>)
> >> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8: opportunity for str_enabled_disabled(on)
>
> Replace ternary (condition ? "enabled" : "disabled") with
> str_enabled_disabled() from string_choices.h to improve readability,
> maintain uniform string usage, and reduce binary size through linker
> deduplication.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502111616.xnebdSv1-lkp@intel.com/
> Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Patch looks fine to me, but netdev requires that the tree for which the
patch is destined to be specified in the subject line - either:
[PATCH net] - strictly for fixes only
[PATCH net-next] - for development/new features
Given that this isn't a user visible bug, net-next would be appropriate.
Please resend with the appropriate tag only after 24 hours have elapsed
after the last interaction with this email thread.
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-16 10:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-15 16:44 [PATCH] net: stmmac: Use str_enabled_disabled() helper Yu-Chun Lin
2025-02-16 2:21 ` Huacai Chen
2025-02-16 10:33 ` Russell King (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).