Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dw-xdata: Use str_write_read() in dw_xdata_start() and dw_xdata_perf()

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

opportunity for str_write_read(write)
opportunity for str_write_read(write)

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250820102108.760382-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
d8959245 dfb962e2

+3 -2
+3 -2
drivers/misc/dw-xdata-pcie.c
··· 16 16 #include <linux/mutex.h> 17 17 #include <linux/delay.h> 18 18 #include <linux/pci.h> 19 + #include <linux/string_choices.h> 19 20 20 21 #define DW_XDATA_DRIVER_NAME "dw-xdata-pcie" 21 22 ··· 133 132 134 133 if (!(status & STATUS_DONE)) 135 134 dev_dbg(dev, "xData: started %s direction\n", 136 - write ? "write" : "read"); 135 + str_write_read(write)); 137 136 } 138 137 139 138 static void dw_xdata_perf_meas(struct dw_xdata *dw, u64 *data, bool write) ··· 196 195 mutex_unlock(&dw->mutex); 197 196 198 197 dev_dbg(dev, "xData: time=%llu us, %s=%llu MB/s\n", 199 - diff, write ? "write" : "read", *rate); 198 + diff, str_write_read(write), *rate); 200 199 } 201 200 202 201 static struct dw_xdata *misc_dev_to_dw(struct miscdevice *misc_dev)