Commit b0b4518c authored by Qianfeng Rong's avatar Qianfeng Rong Committed by Jens Axboe
Browse files

block: use int to store blk_stack_limits() return value

Change the 'ret' variable in blk_stack_limits() from unsigned int to int,
as it needs to store negative value -1.

Storing the negative error codes in unsigned type, or performing equality
comparisons (e.g., ret == -1), doesn't cause an issue at runtime [1] but
can be confusing.  Additionally, assigning negative error codes to unsigned
type may trigger a GCC warning when the -Wsign-conversion flag is enabled.

No effect on runtime.

Link: https://lore.kernel.org/all/x3wogjf6vgpkisdhg3abzrx7v7zktmdnfmqeih5kosszmagqfs@oh3qxrgzkikf/

 #1
Signed-off-by: default avatarQianfeng Rong <rongqianfeng@vivo.com>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Fixes: fe0b393f ("block: Correct handling of bottom device misaligment")
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20250902130930.68317-1-rongqianfeng@vivo.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 34585dc6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment