diff mbox series

[v2,1/3] scsi/utils: Rename 'illegal request' -> 'invalid request'

Message ID 20210120153522.1173897-2-philmd@redhat.com
State New
Headers show
Series hw/usb/dev-uas: Fix Clang 11 -Wgnu-variable-sized-type-not-at-end error | expand

Commit Message

Philippe Mathieu-Daudé Jan. 20, 2021, 3:35 p.m. UTC
While these requests are invalid, they are not breaking any laws :)
Rename 'illegal request' as 'invalid request'.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/scsi/utils.h | 20 ++++++++++----------
 scsi/utils.c         | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

Comments

Eric Blake Jan. 20, 2021, 3:45 p.m. UTC | #1
On 1/20/21 9:35 AM, Philippe Mathieu-Daudé wrote:
> While these requests are invalid, they are not breaking any laws :)
> Rename 'illegal request' as 'invalid request'.
> 
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/scsi/utils.h | 20 ++++++++++----------
>  scsi/utils.c         | 20 ++++++++++----------
>  2 files changed, 20 insertions(+), 20 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Gerd Hoffmann Jan. 20, 2021, 4:15 p.m. UTC | #2
On Wed, Jan 20, 2021 at 04:35:20PM +0100, Philippe Mathieu-Daudé wrote:
> While these requests are invalid, they are not breaking any laws :)
> Rename 'illegal request' as 'invalid request'.

Given the scsi spec calls this "illegal request" I think it makes sense
to *not* change this and stay consistent with the spec for better
grep-ability.  Note the variables are already renamed, I expect the
comments have been left as-is intentionally ...

take care,
  Gerd
Eric Blake Jan. 20, 2021, 4:21 p.m. UTC | #3
On 1/20/21 10:15 AM, Gerd Hoffmann wrote:
> On Wed, Jan 20, 2021 at 04:35:20PM +0100, Philippe Mathieu-Daudé wrote:
>> While these requests are invalid, they are not breaking any laws :)
>> Rename 'illegal request' as 'invalid request'.
> 
> Given the scsi spec calls this "illegal request" I think it makes sense
> to *not* change this and stay consistent with the spec for better
> grep-ability.  Note the variables are already renamed, I expect the
> comments have been left as-is intentionally ...

Consistency with the spec and grep-ability takes precedence over any pet
peeves of mine.  I'm fine if we disregard this patch.
diff mbox series

Patch

diff --git a/include/scsi/utils.h b/include/scsi/utils.h
index fbc55882799..725769be3cb 100644
--- a/include/scsi/utils.h
+++ b/include/scsi/utils.h
@@ -49,25 +49,25 @@  extern const struct SCSISense sense_code_NO_MEDIUM;
 extern const struct SCSISense sense_code_NOT_READY_REMOVAL_PREVENTED;
 /* Hardware error, internal target failure */
 extern const struct SCSISense sense_code_TARGET_FAILURE;
-/* Illegal request, invalid command operation code */
+/* Invalid request, invalid command operation code */
 extern const struct SCSISense sense_code_INVALID_OPCODE;
-/* Illegal request, LBA out of range */
+/* Invalid request, LBA out of range */
 extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE;
-/* Illegal request, Invalid field in CDB */
+/* Invalid request, Invalid field in CDB */
 extern const struct SCSISense sense_code_INVALID_FIELD;
-/* Illegal request, Invalid field in parameter list */
+/* Invalid request, Invalid field in parameter list */
 extern const struct SCSISense sense_code_INVALID_PARAM;
-/* Illegal request, Parameter list length error */
+/* Invalid request, Parameter list length error */
 extern const struct SCSISense sense_code_INVALID_PARAM_LEN;
-/* Illegal request, LUN not supported */
+/* Invalid request, LUN not supported */
 extern const struct SCSISense sense_code_LUN_NOT_SUPPORTED;
-/* Illegal request, Saving parameters not supported */
+/* Invalid request, Saving parameters not supported */
 extern const struct SCSISense sense_code_SAVING_PARAMS_NOT_SUPPORTED;
-/* Illegal request, Incompatible format */
+/* Invalid request, Incompatible format */
 extern const struct SCSISense sense_code_INCOMPATIBLE_FORMAT;
-/* Illegal request, medium removal prevented */
+/* Invalid request, medium removal prevented */
 extern const struct SCSISense sense_code_ILLEGAL_REQ_REMOVAL_PREVENTED;
-/* Illegal request, Invalid Transfer Tag */
+/* Invalid request, Invalid Transfer Tag */
 extern const struct SCSISense sense_code_INVALID_TAG;
 /* Command aborted, I/O process terminated */
 extern const struct SCSISense sense_code_IO_ERROR;
diff --git a/scsi/utils.c b/scsi/utils.c
index b37c2830148..41ad49459ca 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -177,52 +177,52 @@  const struct SCSISense sense_code_TARGET_FAILURE = {
     .key = HARDWARE_ERROR, .asc = 0x44, .ascq = 0x00
 };
 
-/* Illegal request, invalid command operation code */
+/* Invalid request, invalid command operation code */
 const struct SCSISense sense_code_INVALID_OPCODE = {
     .key = ILLEGAL_REQUEST, .asc = 0x20, .ascq = 0x00
 };
 
-/* Illegal request, LBA out of range */
+/* Invalid request, LBA out of range */
 const struct SCSISense sense_code_LBA_OUT_OF_RANGE = {
     .key = ILLEGAL_REQUEST, .asc = 0x21, .ascq = 0x00
 };
 
-/* Illegal request, Invalid field in CDB */
+/* Invalid request, Invalid field in CDB */
 const struct SCSISense sense_code_INVALID_FIELD = {
     .key = ILLEGAL_REQUEST, .asc = 0x24, .ascq = 0x00
 };
 
-/* Illegal request, Invalid field in parameter list */
+/* Invalid request, Invalid field in parameter list */
 const struct SCSISense sense_code_INVALID_PARAM = {
     .key = ILLEGAL_REQUEST, .asc = 0x26, .ascq = 0x00
 };
 
-/* Illegal request, Parameter list length error */
+/* Invalid request, Parameter list length error */
 const struct SCSISense sense_code_INVALID_PARAM_LEN = {
     .key = ILLEGAL_REQUEST, .asc = 0x1a, .ascq = 0x00
 };
 
-/* Illegal request, LUN not supported */
+/* Invalid request, LUN not supported */
 const struct SCSISense sense_code_LUN_NOT_SUPPORTED = {
     .key = ILLEGAL_REQUEST, .asc = 0x25, .ascq = 0x00
 };
 
-/* Illegal request, Saving parameters not supported */
+/* Invalid request, Saving parameters not supported */
 const struct SCSISense sense_code_SAVING_PARAMS_NOT_SUPPORTED = {
     .key = ILLEGAL_REQUEST, .asc = 0x39, .ascq = 0x00
 };
 
-/* Illegal request, Incompatible medium installed */
+/* Invalid request, Incompatible medium installed */
 const struct SCSISense sense_code_INCOMPATIBLE_FORMAT = {
     .key = ILLEGAL_REQUEST, .asc = 0x30, .ascq = 0x00
 };
 
-/* Illegal request, medium removal prevented */
+/* Invalid request, medium removal prevented */
 const struct SCSISense sense_code_ILLEGAL_REQ_REMOVAL_PREVENTED = {
     .key = ILLEGAL_REQUEST, .asc = 0x53, .ascq = 0x02
 };
 
-/* Illegal request, Invalid Transfer Tag */
+/* Invalid request, Invalid Transfer Tag */
 const struct SCSISense sense_code_INVALID_TAG = {
     .key = ILLEGAL_REQUEST, .asc = 0x4b, .ascq = 0x01
 };