linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()
@ 2025-08-19 16:58 Thorsten Blum
  2025-08-20  6:32 ` Geert Uytterhoeven
  2025-09-12  3:56 ` Madhavan Srinivasan
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-08-19 16:58 UTC (permalink / raw)
  To: Geoff Levand, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy
  Cc: Thorsten Blum, linuxppc-dev, linux-kernel

Remove hard-coded strings by using the str_write_read() helper function
and silence the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

  opportunity for str_write_read(write)

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

diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
index a12a1ad9b5fe..3d4d343ee0c8 100644
--- a/drivers/ps3/ps3stor_lib.c
+++ b/drivers/ps3/ps3stor_lib.c
@@ -8,6 +8,7 @@
 
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
+#include <linux/string_choices.h>
 
 #include <asm/lv1call.h>
 #include <asm/ps3stor.h>
@@ -265,7 +266,7 @@ u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
 			       u64 start_sector, u64 sectors, int write)
 {
 	unsigned int region_id = dev->regions[dev->region_idx].id;
-	const char *op = write ? "write" : "read";
+	const char *op = str_write_read(write);
 	int res;
 
 	dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n",
-- 
2.50.1



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

* Re: [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()
  2025-08-19 16:58 [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors() Thorsten Blum
@ 2025-08-20  6:32 ` Geert Uytterhoeven
  2025-09-12  3:56 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2025-08-20  6:32 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Geoff Levand, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, linuxppc-dev, linux-kernel

On Wed, 20 Aug 2025 at 07:26, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> Remove hard-coded strings by using the str_write_read() helper function
> and silence the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
>
>   opportunity for str_write_read(write)
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

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] 3+ messages in thread

* Re: [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()
  2025-08-19 16:58 [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors() Thorsten Blum
  2025-08-20  6:32 ` Geert Uytterhoeven
@ 2025-09-12  3:56 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2025-09-12  3:56 UTC (permalink / raw)
  To: Geoff Levand, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
	Thorsten Blum
  Cc: linuxppc-dev, linux-kernel

On Tue, 19 Aug 2025 18:58:29 +0200, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_write_read() helper function
> and silence the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
> 
>   opportunity for str_write_read(write)
> 
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()
      https://git.kernel.org/powerpc/c/6dc5d0770dc99d6bf9b786fa3c8fc04be2091648

Thanks


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

end of thread, other threads:[~2025-09-12  3:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 16:58 [PATCH] powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors() Thorsten Blum
2025-08-20  6:32 ` Geert Uytterhoeven
2025-09-12  3:56 ` Madhavan Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).