mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: shao.mingyin@zte.com.cn, geoff@infradead.org
Cc: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, naveen@kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, yang.yang29@zte.com.cn,
	xu.xin16@zte.com.cn, ye.xingchen@zte.com.cn,
	feng.wei8@zte.com.cn
Subject: Re: [PATCH] block: ps3disk: Use str_read_write() helper
Date: Tue, 1 Apr 2025 07:18:29 -0600	[thread overview]
Message-ID: <500a6b67-9ce0-4a74-9ae9-59ee0d4990d4@kernel.dk> (raw)
In-Reply-To: <20250401192139605xby4g5ak51tei46zArAT8@zte.com.cn>

On 4/1/25 5:21 AM, shao.mingyin@zte.com.cn wrote:
> From: Feng Wei <feng.wei8@zte.com.cn>
> 
> Remove hard-coded strings by using the str_read_write() helper.
> 
> Signed-off-by: Feng Wei <feng.wei8@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.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

      reply	other threads:[~2025-04-01 13:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 11:21 shao.mingyin
2025-04-01 13:18 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500a6b67-9ce0-4a74-9ae9-59ee0d4990d4@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=christophe.leroy@csgroup.eu \
    --cc=feng.wei8@zte.com.cn \
    --cc=geoff@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=shao.mingyin@zte.com.cn \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    --cc=ye.xingchen@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®