Re: [PATCH V3 2/6] block: add centralize REQ_OP_XXX to string helper

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

 



On 6/18/19 3:00 PM, Chaitanya Kulkarni wrote:
Regarding the correctness, I think if one of the operand is unsigned
then signed values are converted to unsigned valued implicitly.

However the exceptions is if the type of the operand with signed integer
type can represent all of the values of the type of the operand with
unsigned integer type, then the operand with unsigned integer type is
converted to the type of the operand with signed integer type.

I'm wondering how would above scenario occur when comparing int and
size_t. (unless on a platform int can fit all the values into size_t).
Since above comparison of the ARRAY_SIZE involves sizeof (size_t) type
is a base unsigned integer value, even if op < 0 it will get converted
into the unsigned and it will still work.

Please correct me if I'm wrong.

Since a long comment was needed to explain this, that means that the mental effort for anyone who wants to verify the blk_op_str() code is large. Please make sure that kernel code is easy to read and to verify.

Thanks,

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux