On 10/11/2015 07:35, Gonglei wrote:
>> > nb_sectors - int
>> > max_xfer_len - int
>> > req->qiov.size - size_t
>> > BDRV_SECTOR_SIZE - unsigned long long
>> > 
>> > Therefore this expression is an int > unsigned long long comparison.
>> > 
> Sorry, I'm confused.
> max_xfer_len is int,
> "req->qiov.size / BDRV_SECTOR_SIZE" is  unsigned long long,
> so, "max_xfer_len - req->qiov.size / BDRV_SECTOR_SIZE" will be int,

No, the result will be unsigned long long, and the comparison is wrong
if max_xfer_len < req->qiov.size / BDRV_SECTOR_SIZE.

Paolo

> and nb_sectors is int too, so this comparison is right. Am I wrong?
> 

Reply via email to