lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871pvdpmkk.wl-kuninori.morimoto.gx@renesas.com>
Date: Tue, 4 Mar 2025 02:16:27 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Andy Shevchenko <andy@...nel.org>, Kees Cook <kees@...nel.org>, linux-hardening@...r.kernel.org
Subject: [SAMPLE] extcon: rtk-type-c: use string choices helper

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
---
 drivers/extcon/extcon-rtk-type-c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/extcon/extcon-rtk-type-c.c b/drivers/extcon/extcon-rtk-type-c.c
index 82b60b927e41..0c4ecc897a2f 100644
--- a/drivers/extcon/extcon-rtk-type-c.c
+++ b/drivers/extcon/extcon-rtk-type-c.c
@@ -647,12 +647,12 @@ static void host_device_switch(struct work_struct *work)
 			connector_detached(type_c, DISABLE_CC, USB_DR_MODE_PERIPHERAL);
 	} else {
 		dev_err(dev, "Error: IN unknown mode %d to %s at %s (cc_status=0x%x)\n",
-			cc_mode, is_attach ? "attach" : "detach",
+			cc_mode, str_attach_detach(is_attach),
 			at_cc1 ? "cc1" : "cc2", type_c->cc_status);
 	}
 	dev_info(dev, "Connection change OK: IN %s mode to %s at %s (cc_status=0x%x)\n",
 		 cc_mode == IN_HOST_MODE ? "host" : "device",
-		 is_attach ? "attach" : "detach",
+		 str_attach_detach(is_attach),
 		 at_cc1 ? "cc1" : "cc2", type_c->cc_status);
 }
 
@@ -671,7 +671,7 @@ static irqreturn_t type_c_detect_irq(int irq, void *__data)
 		dev_dbg(dev, "%s: IN %s mode to %s (at %s interrupt) int_status=0x%x, cc_status=0x%x",
 			__func__,
 			type_c->cc_mode == IN_HOST_MODE ? "host" : "device",
-			type_c->is_attach ? "attach" : "detach",
+			str_attach_detach(type_c->is_attach),
 			type_c->at_cc1 ? "cc1" : "cc2",
 			type_c->int_status, type_c->cc_status);
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ