[PATCH net-next] r8169: use str_enabled_disabled() helper

Subsystems: 8169 10/100/1000 gigabit ethernet driver, networking drivers, the rest

COLD35d

2 messages, 2 authors, 2026-09-11 · open the first message on its own page

[PATCH net-next] r8169: use str_enabled_disabled() helper

From: Gabriel Windlin <hidden>
Date: 2026-09-08 20:03:39

Replace the open-coded ternary condition (? "enabled" : "disabled")
with the str_enabled_disabled() helper from <linux/string_choices.h>
to improve code readability and maintain uniform string representation.

Signed-off-by: Gabriel Windlin <redacted>
---
 drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 5415ff62a286..360df5284042 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -30,6 +30,7 @@
 #include <linux/prefetch.h>
 #include <linux/ipv6.h>
 #include <linux/unaligned.h>
+#include <linux/string_choices.h>
 #include <net/ip6_checksum.h>
 #include <net/netdev_queues.h>
 
@@ -6225,7 +6226,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	if (tp->dash_type != RTL_DASH_NONE) {
 		netdev_info(dev, "DASH %s\n",
-			    tp->dash_enabled ? "enabled" : "disabled");
+			    str_enabled_disabled(tp->dash_enabled));
 		rtl8168_driver_start(tp);
 	}
 
base-commit: ab217fbb9b2169ce677b09a66558d5c3adcfbb76
-- 
2.55.0

Re: [PATCH net-next] r8169: use str_enabled_disabled() helper

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-09-11 01:44:44

On Tue,  8 Sep 2026 22:03:08 +0200 Gabriel Windlin wrote:
Replace the open-coded ternary condition (? "enabled" : "disabled")
with the str_enabled_disabled() helper from <linux/string_choices.h>
to improve code readability and maintain uniform string representation.
It does not improve readability. Please don't send these sort of
patches to networking.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help