Skip to contentSkip to conversation

powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()

PATCH Applied Thorsten Blum 3 participants 3 messages Aug 19, 2025 – Sep 12, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()

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)

---
 drivers/ps3/ps3stor_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ps3/ps3stor_lib.c +2 -1
index a12a1ad9b5fe..3d4d343ee0c8 100644
@@ -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",
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thorsten Blum

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)

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
maintainer Applied
#2 lore raw
In reply to Thorsten Blum
Quoted 8 lines · Thorsten Blum

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