All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iommu/amd: use str_plural() to simplify the code
@ 2025-08-18  7:05 Xichao Zhao
  2025-08-18 12:52 ` Ankit Soni
  2025-09-05 12:25 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-18  7:05 UTC (permalink / raw)
  To: joro, will
  Cc: christophe.jaillet, suravee.suthikulpanit, robin.murphy, iommu,
	linux-kernel, Xichao Zhao

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

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/iommu/amd/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index eb348c63a8d0..fc11a5dab8ec 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -14,6 +14,7 @@
 #include <linux/pci-ats.h>
 #include <linux/bitmap.h>
 #include <linux/slab.h>
+#include <linux/string_choices.h>
 #include <linux/debugfs.h>
 #include <linux/scatterlist.h>
 #include <linux/dma-map-ops.h>
@@ -265,7 +266,7 @@ static inline int get_acpihid_device_id(struct device *dev,
 		return -EINVAL;
 	if (fw_bug)
 		dev_err_once(dev, FW_BUG "No ACPI device matched UID, but %d device%s matched HID.\n",
-			     hid_count, hid_count > 1 ? "s" : "");
+			     hid_count, str_plural(hid_count));
 	if (hid_count > 1)
 		return -EINVAL;
 	if (entry)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-05 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  7:05 [PATCH v2] iommu/amd: use str_plural() to simplify the code Xichao Zhao
2025-08-18 12:52 ` Ankit Soni
2025-09-05 12:25 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.