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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250818075822.479693-1-zhao.xichao@vivo.com>
Date: Mon, 18 Aug 2025 15:58:22 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: sudipm.mukherjee@...il.com
Cc: linux-kernel@...r.kernel.org,
	Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH] parport: use str_plural() to simplify the code

Use the string choice helper function str_plural() to simplify the code.

Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
 drivers/parport/parport_ip32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index 0919ed99ba94..a45ce3338199 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -372,7 +372,7 @@ static void parport_ip32_dump_state(struct parport *p, char *str,
 		if ((cnfgA & CNFGA_ID_MASK) != CNFGA_ID_8)
 			pr_cont(",%d byte%s left",
 				cnfgA & CNFGA_PWORDLEFT,
-				((cnfgA & CNFGA_PWORDLEFT) > 1) ? "s" : "");
+				str_plural(cnfgA & CNFGA_PWORDLEFT));
 		pr_cont("\n");
 		printk(KERN_DEBUG PPIP32 "    cnfgB=0x%02x", cnfgB);
 		pr_cont(" irq=%u,dma=%u",
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ