Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: Use str_enabled_disabled() helper

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.

Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Link: https://patch.msgid.link/20250217155833.3105775-1-eleanor15x@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yu-Chun Lin and committed by
Jakub Kicinski
3a03f9ec 8f02c48f

+2 -1
+2 -1
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
··· 16 16 #include <linux/slab.h> 17 17 #include <linux/ethtool.h> 18 18 #include <linux/io.h> 19 + #include <linux/string_choices.h> 19 20 #include "stmmac.h" 20 21 #include "stmmac_pcs.h" 21 22 #include "stmmac_ptp.h" ··· 626 625 } 627 626 628 627 netdev_dbg(priv->dev, "Auxiliary Snapshot %s.\n", 629 - on ? "enabled" : "disabled"); 628 + str_enabled_disabled(on)); 630 629 writel(tcr_val, ptpaddr + PTP_TCR); 631 630 632 631 /* wait for auxts fifo clear to finish */