public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>,
	Yihang Li <liyihang9@huawei.com>,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxarm@huawei.com, prime.zeng@huawei.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v5] scsi: sd: Ignore command SYNC CACHE error if format in progress
Date: Tue, 20 Aug 2024 08:19:47 +0900	[thread overview]
Message-ID: <c8a990c3-4b47-4e22-a378-8714c697748a@kernel.org> (raw)
In-Reply-To: <bfce098e-a070-40b1-95fc-951e2b3c1c22@acm.org>

On 8/20/24 01:59, Bart Van Assche wrote:
> On 8/19/24 2:09 AM, Yihang Li wrote:
>> +			if ((sshdr.asc == 0x04 && sshdr.ascq == 0x04) ||
> 
> Shouldn't symbolic names be introduced for these numeric constants?
> Although there is more code in the SCSI core that compares ASC / ASCQ
> values with numeric constants, I think we need symbolic names for these
> constants to make code like the above easier to read. There is already
> a header file for definitions that come directly from the SCSI standard
> and that is used by both SCSI initiator and SCSI target code:
> <scsi/scsi_proto.h>.

That would be *a lot* to define... So in keeping with the current practice of
using numerical values + comment documenting what the values are, it is why I
suggested the comment change above this also as the asc/ascq names for this are
added. It would be odd to have macros for just this asc/ascq here with so many
other places using numerical values...

Note: I personally find https://www.t10.org/lists/1spc-lst.htm more than enough
to work with the scsi code. If we have to define macros for all this, that would
be a lot of lines...

> 
> Thanks,
> 
> Bart.

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-08-19 23:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19  9:09 [PATCH v5] scsi: sd: Ignore command SYNC CACHE error if format in progress Yihang Li
2024-08-19 10:57 ` Damien Le Moal
2024-08-19 16:54   ` Bart Van Assche
2024-08-20  1:25     ` Yihang Li
2024-08-19 16:59 ` Bart Van Assche
2024-08-19 23:19   ` Damien Le Moal [this message]
2024-08-20 21:53     ` Bart Van Assche
2024-08-20  1:24   ` Yihang Li

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=c8a990c3-4b47-4e22-a378-8714c697748a@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liyihang9@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=prime.zeng@huawei.com \
    --cc=stable@vger.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