Re: [PATCH v2 1/3] libsas: Introduce more SAM status code aliases in enum exec_status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18/05/2021 18:50, Bart Van Assche wrote:
index 9271d7a49b90..e68327fa4835 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -474,10 +474,16 @@ enum service_response {
  };
enum exec_status {
-	/* The SAM_STAT_.. codes fit in the lower 6 bits, alias some of
-	 * them here to silence 'case value not in enumerated type' warnings
+	/*
+	 * Values 0..0x7f are used to return the SAM_STAT_* codes.  To avoid
+	 * 'case value not in enumerated type' compiler warnings every value
+	 * returned through the exec_status enum needs an alias with the SAS_
+	 * prefix here.
  	 */
-	__SAM_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION,
+	SAS_STAT_GOOD = SAM_STAT_GOOD,
+	SAS_STAT_BUSY = SAM_STAT_BUSY,
+	SAS_STAT_TASK_ABORTED = SAM_STAT_TASK_ABORTED,
+	SAS_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION,

Personally I prefer SAS_SAM_STAT_xxx, as Christoph mentioned in v1. This helps us know the SAS error codes are aliased from the SAM error codes. And only SAS_STAT_CHECK_CONDITION becomes long, with that suggestion.

I know that you did ask about this solution in v1 series, without reply - sorry.

Ignoring this preference, it looks ok:
Reviewed-by: John Garry <john.garry@xxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux