Re: [PATCH v10 07/33] scsi: sd: Have scsi-ml retry read_capacity_16 errors

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

 



On 7/17/23 10:43 AM, John Garry wrote:
>>
>> -    unsigned char cmd[16];
>> +    static const u8 cmd[16] = { SERVICE_ACTION_IN_16, SAI_READ_CAPACITY_16,
>> +                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RC16_LEN };
> 
> In terms of coding style, could you follow previous style, like:
>     static const u8 cmd[16] = {
>         [0] = SERVICE_ACTION_IN_16,
>         [1] = SAI_READ_CAPACITY_16,
>         [13] = RC16_LEN,
>     };
>     
> Seems safe to me (to ensure we fill in the correct array element).
> 

That's nice. Will fix throughout the patchset.

>> +
>> +        sense_valid = scsi_sense_valid(&sshdr);
>> +        if (sense_valid && sshdr.sense_key == ILLEGAL_REQUEST &&
>> +            (sshdr.asc == 0x20 || sshdr.asc == 0x24) &&
>> +             sshdr.ascq == 0x00)
>> +            /*
>> +             * Invalid Command Operation Code or Invalid Field in
>> +             * CDB, just retry silently with RC10
>> +             */
>> +            return -EINVAL;
> 
> 
> nit: personally I would use {} here, like below, but that's your choice.
> 

Yeah, I like the {} when there's comments. I've got the not needed comment
in other patches so I just kept the previous style.



[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