svn commit: r310524 - in head/sys/cam: ctl scsi

Alexander Motin mav at FreeBSD.org
Wed May 22 15:40:44 UTC 2019


On 22.05.2019 11:21, Alexey Dokuchaev wrote:
> On Sat, Dec 24, 2016 at 05:42:34PM +0000, Alexander Motin wrote:
>> New Revision: 310524
>> URL: https://svnweb.freebsd.org/changeset/base/310524
>>
>> Log:
>>   Improve length handling when writing sense data.
>>   
>>    - Allow maximal sense size limitation via Control Extension mode page.
>>    - When sense size limited, include descriptors atomically: whole or none.
>>    - Set new SDAT_OVFL bit if some descriptors don't fit the limit.
>>    - Report real written sense length instead of static maximal 252 bytes.
>>   
>> Modified: head/sys/cam/scsi/scsi_all.c
>> ...
>> +			}
>> +			if (len > sizeof(sense->cmd_spec_info)) {
>> +				data += len - sizeof(sense->cmd_spec_info);
>> +				len -= len - sizeof(sense->cmd_spec_info);
> 
> PVS Studio complains here: error: V765 A compound assignment expression 'x
> -= x - ...' is suspicious. Consider inspecting it for a possible error.
> 
> This "len -= len - sizeof(...)" indeed looks weird, can you take a look?

It may be weird, but not incorrect.  Fixed though.

-- 
Alexander Motin


More information about the svn-src-head mailing list