Re: [PATCH] block: uapi: Fix compilation errors using ioprio.h with C++

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

 



On 8/14/2023 3:35 PM, Igor Pylypiv wrote:
> On Tue, Aug 15, 2023 at 06:58:32AM +0900, Damien Le Moal wrote:
>> The use of the "class" argument name in the ioprio_value() inline
>> function in include/uapi/linux/ioprio.h confuses C++ compilers
>> resulting in compilation errors such as:
>>
>> /usr/include/linux/ioprio.h:110:43: error: expected primary-expression before ‘int’
>>    110 | static __always_inline __u16 ioprio_value(int class, int level, int hint)
>>        |                                           ^~~
>>
>> for user C++ programs including linux/ioprio.h.
>>
>> Avoid these errors by renaming the arguments of the ioprio_value()
>> function to prioclass, priolevel and priohint. For consistency, the
>> arguments of the IOPRIO_PRIO_VALUE() and IOPRIO_PRIO_VALUE_HINT() macros
>> are also renamed in the same manner.
>>
>> Reported-by: Igor Pylypiv <ipylypiv@xxxxxxxxxx>
>> Fixes: 01584c1e2337 ("scsi: block: Improve ioprio value validity checks")
>> Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
> 

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck





[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