Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: csiostor: Use str_plural() in csio_mem_intr_handler()
@ 2026-07-03 22:17 Thorsten Blum
  2026-07-03 22:32 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-07-03 22:17 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen, Kees Cook
  Cc: Thorsten Blum, linux-scsi, linux-kernel

Replace the manual ternary "s" pluralization with str_plural() to
simplify the code. This also corrects the "0 errors" case.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/scsi/csiostor/csio_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index df9f81f29950..44def5f92b68 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -38,6 +38,7 @@
 #include <linux/stddef.h>
 #include <linux/delay.h>
 #include <linux/string.h>
+#include <linux/string_choices.h>
 #include <linux/compiler.h>
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
@@ -3490,7 +3491,7 @@ static void csio_mem_intr_handler(struct csio_hw *hw, int idx)
 
 		csio_wr_reg32(hw, ECC_CECNT_V(ECC_CECNT_M), cnt_addr);
 		csio_warn(hw, "%u %s correctable ECC data error%s\n",
-			    cnt, name[idx], cnt > 1 ? "s" : "");
+			  cnt, name[idx], str_plural(cnt));
 	}
 	if (v & ECC_UE_INT_CAUSE_F)
 		csio_fatal(hw, "%s uncorrectable ECC data error\n", name[idx]);

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

* Re: [PATCH] scsi: csiostor: Use str_plural() in csio_mem_intr_handler()
  2026-07-03 22:17 [PATCH] scsi: csiostor: Use str_plural() in csio_mem_intr_handler() Thorsten Blum
@ 2026-07-03 22:32 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-07-03 22:32 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: linux-scsi

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch introduces a build failure by including a non-existent header `<linux/string_choices.h>` and calling an undefined function `str_plural()`.
--

commit cdb7701e8f1bfc8ec07f47cf6dd02c5a65955713
Author: Thorsten Blum <thorsten.blum@linux.dev>

scsi: csiostor: Use str_plural() in csio_mem_intr_handler()

This patch simplifies the pluralization logic in csio_mem_intr_handler()
by replacing a manual ternary operator with the str_plural() helper.
It also adds the string_choices.h header to support this function.

> diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
> --- a/drivers/scsi/csiostor/csio_hw.c
> +++ b/drivers/scsi/csiostor/csio_hw.c
> @@ -38,6 +38,7 @@
>  #include <linux/stddef.h>
>  #include <linux/delay.h>
>  #include <linux/string.h>
> +#include <linux/string_choices.h>

[Severity: Low]
Does this header exist in the current tree? It appears that including
linux/string_choices.h might cause a build failure if the header is not
present in this kernel version.

[ ... ]

> @@ -3026,7 +3027,7 @@ static void csio_mem_intr_handler(struct csio_hw *hw, int idx)
>  
>  		csio_wr_reg32(hw, ECC_CECNT_V(ECC_CECNT_M), cnt_addr);
>  		csio_warn(hw, "%u %s correctable ECC data error%s\n",
> -			    cnt, name[idx], cnt > 1 ? "s" : "");
> +			  cnt, name[idx], str_plural(cnt));

[Severity: Low]
Is str_plural() defined in this kernel version? If the helper function
is missing, this will result in an undeclared function error during
compilation.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260703221731.180534-3-thorsten.blum@linux.dev?part=1

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

end of thread, other threads:[~2026-07-03 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 22:17 [PATCH] scsi: csiostor: Use str_plural() in csio_mem_intr_handler() Thorsten Blum
2026-07-03 22:32 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox