[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <500a6b67-9ce0-4a74-9ae9-59ee0d4990d4@kernel.dk>
Date: Tue, 1 Apr 2025 07:18:29 -0600
From: Jens Axboe <axboe@...nel.dk>
To: shao.mingyin@....com.cn, geoff@...radead.org
Cc: maddy@...ux.ibm.com, mpe@...erman.id.au, npiggin@...il.com,
christophe.leroy@...roup.eu, naveen@...nel.org,
linuxppc-dev@...ts.ozlabs.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, yang.yang29@....com.cn, xu.xin16@....com.cn,
ye.xingchen@....com.cn, feng.wei8@....com.cn
Subject: Re: [PATCH] block: ps3disk: Use str_read_write() helper
On 4/1/25 5:21 AM, shao.mingyin@....com.cn wrote:
> From: Feng Wei <feng.wei8@....com.cn>
>
> Remove hard-coded strings by using the str_read_write() helper.
>
> Signed-off-by: Feng Wei <feng.wei8@....com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@....com.cn>
> ---
> drivers/block/ps3disk.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
> index dc9e4a14b885..b7fe90b6fdef 100644
> --- a/drivers/block/ps3disk.c
> +++ b/drivers/block/ps3disk.c
> @@ -9,6 +9,7 @@
> #include <linux/ata.h>
> #include <linux/blk-mq.h>
> #include <linux/slab.h>
> +#include <linux/string_choices.h>
> #include <linux/module.h>
>
> #include <asm/lv1call.h>
> @@ -233,7 +234,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
> op = "flush";
> } else {
> read = !rq_data_dir(req);
> - op = read ? "read" : "write";
> + op = str_read_write(read);
> }
> if (status) {
> dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__,
If you're doing this, why not kill off the useless 'read' variable as
well?
--
Jens Axboe
Powered by blists - more mailing lists