Skip to content
Commit afae461a authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Damien Le Moal
Browse files

ata: libata-eh: fix sloppy result type of ata_eh_nr_in_flight()



ata_eh_nr_in_flight() counts the # of the active tagged commands and
thus cannot return a negative value but the result type is nevertheless
int.  Switching it to unsigned int (along with the local variables
receiving the function's result) helps avoiding the sign extension
instructions when comparing with or assigning to unsigned long
ata_port::fastdrain_cnt and thus results in a more compact 64-bit
code.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

[Damien]
Fixed commit message.

Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 4d6119f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment