From: John Garry <john.g.garry@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Niklas Cassel <cassel@kernel.org>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
Nihar Panda <niharp@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Khalid Aziz <khalid@gonehiking.org>,
Finn Thain <fthain@linux-m68k.org>,
Michael Schmitz <schmitzmic@gmail.com>,
Adaptec OEM Raid Solutions <aacraid@microsemi.com>,
Russell King <linux@armlinux.org.uk>,
Anil Gurumurthy <anil.gurumurthy@qlogic.com>,
Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>,
Saurav Kashyap <skashyap@marvell.com>,
Javed Hasan <jhasan@marvell.com>,
GR-QLogic-Storage-Upstream@marvell.com,
Satish Kharat <satishkh@cisco.com>,
Sesidhar Baddela <sebaddel@cisco.com>,
Karan Tilak Kumar <kartilak@cisco.com>,
Don Brace <don.brace@microchip.com>,
Tyrel Datwyler <tyreld@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Brian King <brking@us.ibm.com>, Hannes Reinecke <hare@suse.de>,
Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>,
Mike Christie <michael.christie@oracle.com>,
Justin Tee <justin.tee@broadcom.com>,
Paul Ely <paul.ely@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Shivasharan S <shivasharan.srikanteshwara@broadcom.com>,
Chandrakanth patil <chandrakanth.patil@broadcom.com>,
GOTO Masanori <gotom@debian.or.jp>,
Nilesh Javali <njavali@marvell.com>,
Manish Rangankar <mrangankar@marvell.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Long Li <longli@microsoft.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>, Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Oliver Neukum <oliver@neukum.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Easwar Hariharan <easwar.hariharan@linux.microsoft.com>,
Allen Pais <apais@linux.microsoft.com>,
Chaitanya Kulkarni <kch@nvidia.com>,
Guixin Liu <kanie@linux.alibaba.com>,
Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>,
Peter Wang <peter.wang@mediatek.com>,
Avri Altman <avri.altman@sandisk.com>,
Bean Huo <beanhuo@micron.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>
Subject: Re: [PATCH] scsi: Change the return type of the .queuecommand() callback
Date: Wed, 7 Jan 2026 08:58:43 +0000 [thread overview]
Message-ID: <6510d236-cc06-428e-9d28-c1a104f408dd@oracle.com> (raw)
In-Reply-To: <20260106185310.2524290-1-bvanassche@acm.org>
On 06/01/2026 18:52, Bart Van Assche wrote:
> Let the compiler verify whether a valid value is returned by the
> .queuecommand() implementations by changing their return type from 'int'
> into 'enum scsi_qc_status'. No functionality has been changed.
>
> Cc: Damien Le Moal <dlemoal@kernel.org>
> Cc: John Garry <john.g.garry@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
Using enum scsi_qc_status over an int makes the code less condense...
scsi_qc_sts might have been a better name, although I do realise that
this was introduced in another change.
BTW, are there any drivers which were not passing back a scsi_qc_status
type? I assume not.
On 06/01/2026 18:52, Bart Van Assche wrote:
> +static enum scsi_qc_status sbp2_scsi_queuecommand(struct Scsi_Host
*shost,
> + struct scsi_cmnd *cmd)
> {
> struct sbp2_logical_unit *lu = cmd->device->hostdata;
> struct fw_device *device = target_parent_device(lu->tgt);
> struct sbp2_command_orb *orb;
> - int generation, retval = SCSI_MLQUEUE_HOST_BUSY;
> + int generation;
> + enum scsi_qc_status retval = SCSI_MLQUEUE_HOST_BUSY;
I suggest trying to maintain the reverse fir tree style, when possible.
I do realise that it is not the case here, but it was close.
> index e87cf7eadd26..41ba6e7e799a 100644
> --- a/include/scsi/scsi_host.h
> +++ b/include/scsi/scsi_host.h
> @@ -84,13 +84,15 @@ struct scsi_host_template {
> *
> * STATUS: REQUIRED
> */
> - int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
> + enum scsi_qc_status (* queuecommand)(struct Scsi_Host *,
please remove unnecessary whitespace before "queuecommand"
> + struct scsi_cmnd *);
>
> /*
On 06/01/2026 18:52, Bart Van Assche wrote:
> #define DEF_SCSI_QCMD(func_name) \
> - int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \
> + enum scsi_qc_status func_name(struct Scsi_Host *shost, \
> + struct scsi_cmnd *cmd) \
> { \
> unsigned long irq_flags; \
> int rc;
why not an enum scsi_qc_status?
Note I have not fully gone through the change in the patch.
next prev parent reply other threads:[~2026-01-07 8:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 18:52 [PATCH] scsi: Change the return type of the .queuecommand() callback Bart Van Assche
2026-01-07 8:58 ` John Garry [this message]
2026-01-07 12:36 ` James Bottomley
2026-01-07 17:09 ` Bart Van Assche
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=6510d236-cc06-428e-9d28-c1a104f408dd@oracle.com \
--to=john.g.garry@oracle.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=aacraid@microsemi.com \
--cc=adrian.hunter@intel.com \
--cc=agordeev@linux.ibm.com \
--cc=anil.gurumurthy@qlogic.com \
--cc=apais@linux.microsoft.com \
--cc=avri.altman@sandisk.com \
--cc=axboe@kernel.dk \
--cc=beanhuo@micron.com \
--cc=brking@us.ibm.com \
--cc=bvanassche@acm.org \
--cc=cassel@kernel.org \
--cc=chandrakanth.patil@broadcom.com \
--cc=cleech@redhat.com \
--cc=corbet@lwn.net \
--cc=decui@microsoft.com \
--cc=dlemoal@kernel.org \
--cc=don.brace@microchip.com \
--cc=easwar.hariharan@linux.microsoft.com \
--cc=fthain@linux-m68k.org \
--cc=gor@linux.ibm.com \
--cc=gotom@debian.or.jp \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=hamzamahfooz@linux.microsoft.com \
--cc=hare@suse.de \
--cc=hca@linux.ibm.com \
--cc=jasowang@redhat.com \
--cc=jgg@ziepe.ca \
--cc=jgross@suse.com \
--cc=jhasan@marvell.com \
--cc=justin.tee@broadcom.com \
--cc=kanie@linux.alibaba.com \
--cc=kartilak@cisco.com \
--cc=kashyap.desai@broadcom.com \
--cc=kch@nvidia.com \
--cc=khalid@gonehiking.org \
--cc=kys@microsoft.com \
--cc=lduncan@suse.com \
--cc=leon@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=longli@microsoft.com \
--cc=maddy@linux.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=mingo@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=mrangankar@marvell.com \
--cc=mst@redhat.com \
--cc=niharp@linux.ibm.com \
--cc=njavali@marvell.com \
--cc=o-takashi@sakamocchi.jp \
--cc=oliver@neukum.org \
--cc=paul.ely@broadcom.com \
--cc=peter.wang@mediatek.com \
--cc=quic_nguyenb@quicinc.com \
--cc=rdunlap@infradead.org \
--cc=sathya.prakash@broadcom.com \
--cc=satishkh@cisco.com \
--cc=schmitzmic@gmail.com \
--cc=sebaddel@cisco.com \
--cc=shivasharan.srikanteshwara@broadcom.com \
--cc=skashyap@marvell.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=sstabellini@kernel.org \
--cc=sudarsana.kalluru@qlogic.com \
--cc=suganath-prabu.subramani@broadcom.com \
--cc=sumit.saxena@broadcom.com \
--cc=tglx@linutronix.de \
--cc=tyreld@linux.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wei.liu@kernel.org \
/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