Commit 36446de
ublk: fix tautological comparison warning in ublk_ctrl_reg_buf
On 32-bit architectures, 'unsigned long size' can never exceed
UBLK_SHMEM_BUF_SIZE_MAX (1ULL << 32), causing a tautological
comparison warning. Validate buf_reg.len (__u64) directly before
using it, and consolidate all input validation into a single check.
Also remove the unnecessary local variables 'addr' and 'size' since
buf_reg.addr and buf_reg.len can be used directly.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604101952.3NOzqnu9-lkp@intel.com/
Fixes: 23b3b6f ("ublk: widen ublk_shmem_buf_reg.len to __u64 for 4GB buffer support")
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20260410124136.3983429-1-tom.leiming@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 0a42ca4 commit 36446de
1 file changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5330 | 5330 | | |
5331 | 5331 | | |
5332 | 5332 | | |
5333 | | - | |
| 5333 | + | |
5334 | 5334 | | |
5335 | 5335 | | |
5336 | 5336 | | |
| |||
5352 | 5352 | | |
5353 | 5353 | | |
5354 | 5354 | | |
5355 | | - | |
5356 | | - | |
5357 | | - | |
5358 | | - | |
5359 | | - | |
5360 | | - | |
| 5355 | + | |
| 5356 | + | |
5361 | 5357 | | |
5362 | 5358 | | |
| 5359 | + | |
| 5360 | + | |
5363 | 5361 | | |
5364 | 5362 | | |
5365 | 5363 | | |
| |||
5369 | 5367 | | |
5370 | 5368 | | |
5371 | 5369 | | |
5372 | | - | |
| 5370 | + | |
5373 | 5371 | | |
5374 | 5372 | | |
5375 | 5373 | | |
| |||
0 commit comments