public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: John Garry <john.garry@huawei.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 2/3] Introduce enums for the SAM, message, host and driver status codes
Date: Mon, 17 May 2021 08:12:10 -0700	[thread overview]
Message-ID: <91b3f885-dbda-c6c7-ccfe-36349afa65a3@acm.org> (raw)
In-Reply-To: <178da9e9-7946-e0e1-1ab7-593fa94c17c9@huawei.com>

On 5/17/21 3:38 AM, John Garry wrote:
> On 15/05/2021 00:23, Bart Van Assche wrote:
>> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
>> index 84d73f57292b..d8774998ec6d 100644
>> --- a/drivers/scsi/constants.c
>> +++ b/drivers/scsi/constants.c
>> @@ -413,7 +413,7 @@ static const char * const driverbyte_table[]={
>>   const char *scsi_hostbyte_string(int result)
>>   {
>>       const char *hb_string = NULL;
>> -    int hb = host_byte(result);
>> +    enum host_status hb = host_byte(result);
>>   
> nit: I figure that this code had been consciously written to use
> reverse-Christmas tree style, so maybe we can maintain it

Ah, that's something I was not aware of. I will fix this.

>> --- a/drivers/target/target_core_pscsi.c
>> +++ b/drivers/target/target_core_pscsi.c
>> @@ -1044,7 +1044,7 @@ static void pscsi_req_done(struct request *req,
>> blk_status_t status)
>>       struct se_cmd *cmd = req->end_io_data;
>>       struct pscsi_plugin_task *pt = cmd->priv;
>>       int result = scsi_req(req)->result;
>> -    u8 scsi_status = status_byte(result) << 1;
>> +    enum sam_status scsi_status = status_byte(result) << 1;
> 
> Is someone going to be fixing up drivers elsewhere to use these enums?

I plan to repost the patch series that fixes up the SCSI LLDs after this
patch series has been accepted.

>> +/* Host byte codes. */
>> +enum host_status {
> 
> Just wondered is it intentional that we don't prefix "scsi_" to the enum
> name? Would it be because none of the symbols, below, don't?

I will add the prefix "scsi_" to these enumeration type names.

Thanks,

Bart.

  reply	other threads:[~2021-05-17 15:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 23:23 [PATCH 0/3] Introduce enums for SCSI status codes Bart Van Assche
2021-05-14 23:23 ` [PATCH 1/3] libsas: Introduce more SAM status code aliases in enum exec_status Bart Van Assche
2021-05-15  6:44   ` Christoph Hellwig
2021-05-17 15:45     ` Bart Van Assche
2021-05-14 23:23 ` [PATCH 2/3] Introduce enums for the SAM, message, host and driver status codes Bart Van Assche
2021-05-17 10:38   ` John Garry
2021-05-17 15:12     ` Bart Van Assche [this message]
2021-05-14 23:23 ` [PATCH 3/3] Change the type of the second argument of scsi_host_complete_all_commands() 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=91b3f885-dbda-c6c7-ccfe-36349afa65a3@acm.org \
    --to=bvanassche@acm.org \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=john.garry@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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