Re: [PATCH] ublk: fix narrowing warnings in UAPI header
From: Ming Lei
Date: Sun Jun 22 2025 - 21:41:12 EST
On Sat, Jun 21, 2025 at 10:28:41AM -0600, Caleb Sander Mateos wrote:
> When a C++ file compiled with -Wc++11-narrowing includes the UAPI header
> linux/ublk_cmd.h, ublk_sqe_addr_to_auto_buf_reg()'s assignments of u64
> values to u8, u16, and u32 fields result in compiler warnings. Add
> explicit casts to the intended types to avoid these warnings. Drop the
> unnecessary bitmasks.
>
> Reported-by: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
> Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
> Fixes: 99c1e4eb6a3f ("ublk: register buffer to local io_uring with provided buf index via UBLK_F_AUTO_BUF_REG")
Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>
thanks,
Ming