[PATCH] pwm: core: Use str_plural() in pwm_seq_show()

From: Jiapeng Chong
Date: Tue Jun 18 2024 - 06:22:48 EST


Use existing str_plural() function rather than duplicating its
implementation.

./drivers/pwm/core.c:1690:6-16: opportunity for str_plural(chip->npwm).

Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9352
Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>
---
drivers/pwm/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 5c1d20985148..141c5003b216 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1687,7 +1687,7 @@ static int pwm_seq_show(struct seq_file *s, void *v)
(char *)s->private, chip->id,
pwmchip_parent(chip)->bus ? pwmchip_parent(chip)->bus->name : "no-bus",
dev_name(pwmchip_parent(chip)), chip->npwm,
- (chip->npwm != 1) ? "s" : "");
+ str_plural(chip->npwm));

pwm_dbg_show(chip, s);

--
2.20.1.7.g153144c