public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Yang Xiuwei <yangxiuwei@kylinos.cn>,
	fujita.tomonori@lab.ntt.co.jp, axboe@kernel.dk,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] scsi: bsg: add io_uring passthrough handler
Date: Thu, 5 Mar 2026 09:39:24 -0600	[thread overview]
Message-ID: <b3d4d3c0-3992-44be-827b-e9089ab4471c@acm.org> (raw)
In-Reply-To: <20260305012857.2136525-4-yangxiuwei@kylinos.cn>

On 3/4/26 7:28 PM, Yang Xiuwei wrote:
> +			u8 device_status;	/* SCSI device status (low 8 bits of result) */
> +			u8 driver_status;	/* SCSI driver status (DRIVER_SENSE if check) */
> +			u8 host_status;		/* SCSI host status (host_byte of result) */

Why separate members for device_status, driver_status and host_status 
instead of storing the SCSI result (scsi_cmnd.result)?

> +	/* Build res2 with status information */
> +	res2 = ((u64)pdu->resid_len << 32) |
> +	       ((u64)(pdu->scsi.sense_len_wr & 0xff) << 24) |
> +	       ((u64)(pdu->scsi.host_status & 0xff) << 16) |
> +	       ((u64)(pdu->scsi.driver_status & 0xff) << 8) |
> +	       (pdu->scsi.device_status & 0xff);

Please remove the superfluous " & 0xff" from u8 expressions.

> +	pdu->scsi.device_status = scmd->result & 0xff;

Please use the status_byte() macro instead of open-coding it.

Thanks,

Bart.

  reply	other threads:[~2026-03-05 15:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  8:03 [PATCH v5 0/3] bsg: add io_uring command support for SCSI passthrough Yang Xiuwei
2026-03-04  8:03 ` [PATCH v5 1/3] bsg: add bsg_uring_cmd uapi structure Yang Xiuwei
2026-03-04  8:03 ` [PATCH v5 2/3] bsg: add io_uring command support to generic layer Yang Xiuwei
2026-03-04  8:03 ` [PATCH v5 3/3] scsi: bsg: add io_uring passthrough handler Yang Xiuwei
2026-03-04 13:50   ` kernel test robot
2026-03-05  1:28 ` [PATCH v6 0/3] bsg: add io_uring command support for SCSI passthrough Yang Xiuwei
2026-03-05  1:28   ` [PATCH v6 1/3] bsg: add bsg_uring_cmd uapi structure Yang Xiuwei
2026-03-05 15:14     ` Bart Van Assche
2026-03-06  2:54       ` Yang Xiuwei
2026-03-05  1:28   ` [PATCH v6 2/3] bsg: add io_uring command support to generic layer Yang Xiuwei
2026-03-05 15:17     ` Bart Van Assche
2026-03-06  3:03       ` Yang Xiuwei
2026-03-05  1:28   ` [PATCH v6 3/3] scsi: bsg: add io_uring passthrough handler Yang Xiuwei
2026-03-05 15:39     ` Bart Van Assche [this message]
2026-03-06  3:04       ` Yang Xiuwei
2026-03-05 15:12   ` [PATCH v6 0/3] bsg: add io_uring command support for SCSI passthrough Bart Van Assche
2026-03-06  2:46     ` Yang Xiuwei

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=b3d4d3c0-3992-44be-827b-e9089ab4471c@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@kernel.dk \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yangxiuwei@kylinos.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