Thread (20 messages) 20 messages, 8 authors, 2025-12-19

Re: (subset) [PATCH 00/44] Change a lot of min_t() that might mask high bits

From: Jens Axboe <axboe@kernel.dk>
Date: 2025-11-20 14:52:48
Also in: amd-gfx, bpf, cgroups, dri-devel, io-uring, kvm, linux-acpi, linux-block, linux-crypto, linux-cxl, linux-efi, linux-ext4, linux-fsdevel, linux-gpio, linux-i2c, linux-integrity, linux-mm, linux-nvme, linux-pci, linux-perf-users, linux-scsi, linux-serial, linux-trace-kernel, linux-usb, lkml, mptcp

On Wed, 19 Nov 2025 22:40:56 +0000, david.laight.linux@gmail.com wrote:
It in not uncommon for code to use min_t(uint, a, b) when one of a or b
is 64bit and can have a value that is larger than 2^32;
This is particularly prevelant with:
	uint_var = min_t(uint, uint_var, uint64_expression);

Casts to u8 and u16 are very likely to discard significant bits.

[...]
Applied, thanks!

[12/44] block: use min() instead of min_t()
        commit: 9420e720ad192c53c8d2803c5a2313b2d586adbd

Best regards,
-- 
Jens Axboe


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help