All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: sq: use str_plural helper in sq_remap
@ 2026-06-04 11:12 Thorsten Blum
  2026-06-04 11:30 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-06-04 11:12 UTC (permalink / raw)
  To: Rich Felker, John Paul Adrian Glaubitz, Kees Cook
  Cc: Thorsten Blum, linux-sh, linux-kernel

Replace the manual ternary "s" pluralization with str_plural() to
simplify the code. Use the format specifier %-1s to preserve the
whitespace alignment.

Simplify the map->name ternary expression while at it.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/sh/kernel/cpu/sh4/sq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 908a8e09113b..0f9244be6dcc 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/string_choices.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/io.h>
@@ -181,9 +182,8 @@ unsigned long sq_remap(unsigned long phys, unsigned int size,
 		goto out;
 
 	psz = (size + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
-	pr_info("sqremap: %15s  [%4d page%s]  va 0x%08lx   pa 0x%08lx\n",
-		likely(map->name) ? map->name : "???",
-		psz, psz == 1 ? " " : "s",
+	pr_info("sqremap: %15s  [%4d page%-1s]  va 0x%08lx   pa 0x%08lx\n",
+		map->name ?: "???", psz, str_plural(psz),
 		map->sq_addr, map->addr);
 
 	sq_mapping_list_add(map);

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

* Re: [PATCH] sh: sq: use str_plural helper in sq_remap
  2026-06-04 11:12 [PATCH] sh: sq: use str_plural helper in sq_remap Thorsten Blum
@ 2026-06-04 11:30 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2026-06-04 11:30 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Rich Felker, John Paul Adrian Glaubitz, Kees Cook, linux-sh,
	linux-kernel

On Thu, 4 Jun 2026 at 13:20, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> Replace the manual ternary "s" pluralization with str_plural() to
> simplify the code. Use the format specifier %-1s to preserve the
> whitespace alignment.
>
> Simplify the map->name ternary expression while at it.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2026-06-04 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 11:12 [PATCH] sh: sq: use str_plural helper in sq_remap Thorsten Blum
2026-06-04 11:30 ` Geert Uytterhoeven

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.