]> www.infradead.org Git - users/hch/misc.git/commitdiff
powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors()
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 19 Aug 2025 16:58:29 +0000 (18:58 +0200)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sat, 6 Sep 2025 11:31:26 +0000 (17:01 +0530)
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>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250819165829.714344-2-thorsten.blum@linux.dev
drivers/ps3/ps3stor_lib.c

index a12a1ad9b5fe35c50a48e086908dc119e0dd8003..3d4d343ee0c8fbe2024b92ae33c40859d4e17ba3 100644 (file)
@@ -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",