Martin,

On 4/25/17 08:11, Martin K. Petersen wrote:
> 
> Christoph,
> 
>> Use a switch for the sense key, and remove two pointless variables
>> that are only used once.
> 
>> -                            if (unmap)
> 
> The rationale behind the unmap variable was clarity and avoiding magic
> values.
> 
> I'm OK with this, however:
> 
>> +                            if (SCpnt->cmnd[1] & 8) { /* UNMAP */
> 
> So I committed with that change.

Thank you for the commit.

Just one remark:
You left the "good_bytes = 0;" in the else statement of the
ILLEGAL_REQUEST && asc == 0x24 && command == WRITE_SAME case. Is it
really necessary ?

good_bytes is already set to 0 at the beginning of sd_done() when result
!= 0 and again within the initial switch-case for REQ_OP_DISCARD and
REQ_OP_WRITE_SAME cases, which are the only commands that can lead to
hitting that "else" part in the sense data processing.
I may be missing something, but I think that that assignment is redundant.

Best regards.

-- 
Damien Le Moal, Ph.D.
Sr. Manager, System Software Research Group,
Western Digital Corporation
[email protected]
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.wdc.com, www.hgst.com

Reply via email to