Re: [PATCH] block: uapi: Fix compilation errors using ioprio.h with C++
From: Chaitanya Kulkarni <hidden>
Date: 2023-08-15 01:01:22
From: Chaitanya Kulkarni <hidden>
Date: 2023-08-15 01:01:22
On 8/14/2023 3:35 PM, Igor Pylypiv wrote:
On Tue, Aug 15, 2023 at 06:58:32AM +0900, Damien Le Moal wrote:quoted
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 <redacted> Fixes: 01584c1e2337 ("scsi: block: Improve ioprio value validity checks") Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> -ck