* [PATCH] i2c: algo: bit: use str_plural helper in bit_xfer
@ 2026-05-11 10:49 Thorsten Blum
2026-06-06 21:20 ` Thorsten Blum
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-05-11 10:49 UTC (permalink / raw)
To: Andi Shyti; +Cc: Thorsten Blum, linux-i2c, linux-kernel
Replace the manual ternary "s" pluralizations with str_plural() to
simplify the code.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/i2c/algos/i2c-algo-bit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 6544d27e4419..d1d9a6c1a1e2 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -13,6 +13,7 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/string_choices.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
@@ -562,7 +563,7 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
ret = readbytes(i2c_adap, pmsg);
if (ret >= 1)
bit_dbg(2, &i2c_adap->dev, "read %d byte%s\n",
- ret, ret == 1 ? "" : "s");
+ ret, str_plural(ret));
if (ret < pmsg->len) {
if (ret >= 0)
ret = -EIO;
@@ -573,7 +574,7 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
ret = sendbytes(i2c_adap, pmsg);
if (ret >= 1)
bit_dbg(2, &i2c_adap->dev, "wrote %d byte%s\n",
- ret, ret == 1 ? "" : "s");
+ ret, str_plural(ret));
if (ret < pmsg->len) {
if (ret >= 0)
ret = -EIO;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] i2c: algo: bit: use str_plural helper in bit_xfer
2026-05-11 10:49 [PATCH] i2c: algo: bit: use str_plural helper in bit_xfer Thorsten Blum
@ 2026-06-06 21:20 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2026-06-06 21:20 UTC (permalink / raw)
To: Andi Shyti; +Cc: linux-i2c, linux-kernel
Gentle ping?
On Mon, May 11, 2026 at 12:49:13PM +0200, Thorsten Blum wrote:
> Replace the manual ternary "s" pluralizations with str_plural() to
> simplify the code.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/i2c/algos/i2c-algo-bit.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
> index 6544d27e4419..d1d9a6c1a1e2 100644
> --- a/drivers/i2c/algos/i2c-algo-bit.c
> +++ b/drivers/i2c/algos/i2c-algo-bit.c
> @@ -13,6 +13,7 @@
> #include <linux/delay.h>
> #include <linux/errno.h>
> #include <linux/sched.h>
> +#include <linux/string_choices.h>
> #include <linux/i2c.h>
> #include <linux/i2c-algo-bit.h>
>
> @@ -562,7 +563,7 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
> ret = readbytes(i2c_adap, pmsg);
> if (ret >= 1)
> bit_dbg(2, &i2c_adap->dev, "read %d byte%s\n",
> - ret, ret == 1 ? "" : "s");
> + ret, str_plural(ret));
> if (ret < pmsg->len) {
> if (ret >= 0)
> ret = -EIO;
> @@ -573,7 +574,7 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
> ret = sendbytes(i2c_adap, pmsg);
> if (ret >= 1)
> bit_dbg(2, &i2c_adap->dev, "wrote %d byte%s\n",
> - ret, ret == 1 ? "" : "s");
> + ret, str_plural(ret));
> if (ret < pmsg->len) {
> if (ret >= 0)
> ret = -EIO;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-06 21:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 10:49 [PATCH] i2c: algo: bit: use str_plural helper in bit_xfer Thorsten Blum
2026-06-06 21:20 ` Thorsten Blum
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.