Re: [PATCH 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 5/14/21 11:44 PM, Christoph Hellwig wrote:
>> index 9271d7a49b90..9b17f7c8c314 100644
>> --- a/include/scsi/libsas.h
>> +++ b/include/scsi/libsas.h
>> @@ -477,6 +477,9 @@ 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
>>  	 */
>> +	__SAM_STAT_GOOD = SAM_STAT_GOOD,
>> +	__SAM_STAT_BUSY = SAM_STAT_BUSY,
>> +	__SAM_STAT_TASK_ABORTED = SAM_STAT_TASK_ABORTED,
>>  	__SAM_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION,
> 
> I don't think the (existing) naming and comment are very helpful here.
> 
> I'd so a s/__SAM_/SAS_SAM_/

Hi Christoph,

How about changing __SAM_STAT_ into SAS_STAT_ to keep the prefix short?

> and replace the comment with something like:
> 
> 	/*
> 	 * The first 6 bytes 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 will need an alias with
> 	 * the SAS_ prefix here.
> 	 */
> 	SAS_SAM_STAT_GOOD = SAM_STAT_GOOD,
> 	SAS_SAM_STAT_BUSY = SAM_STAT_BUSY,
> 	...

There is another issue with that comment: 7 bits are required to
represent status code 40h - TASK ABORTED. Anyway, thanks for having
taken a look. I will update the comment.

Bart.






[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