[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37faa705-4ea0-4dc8-a0d4-c26acf743c6b@wanadoo.fr>
Date: Mon, 18 Aug 2025 08:53:42 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Xichao Zhao <zhao.xichao@...o.com>, joro@...tes.org, will@...nel.org
Cc: suravee.suthikulpanit@....com, robin.murphy@....com,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu/amd: use str_plural() to simplify the code
Le 18/08/2025 à 05:53, Xichao Zhao a écrit :
> Use the string choice helper function str_plural() to simplify the code.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
Hi,
> ---
> drivers/iommu/amd/iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index eb348c63a8d0..b5c829f89544 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -265,7 +265,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));
Nitpick: There is a double space after the comma.
> if (hid_count > 1)
> return -EINVAL;
> if (entry)
You should also include <linux/string_choices.h> I think.
CJ
Powered by blists - more mailing lists