Skip to content

Commit 3a03f9e

Browse files
eleanorLYJkuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Signed-off-by: Yu-Chun Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8f02c48 commit 3a03f9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/slab.h>
1717
#include <linux/ethtool.h>
1818
#include <linux/io.h>
19+
#include <linux/string_choices.h>
1920
#include "stmmac.h"
2021
#include "stmmac_pcs.h"
2122
#include "stmmac_ptp.h"
@@ -625,7 +626,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
625626
}
626627

627628
netdev_dbg(priv->dev, "Auxiliary Snapshot %s.\n",
628-
on ? "enabled" : "disabled");
629+
str_enabled_disabled(on));
629630
writel(tcr_val, ptpaddr + PTP_TCR);
630631

631632
/* wait for auxts fifo clear to finish */

0 commit comments

Comments
 (0)