]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drivers/xen: use min() instead of min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:25 +0000 (22:41 +0000)
committerJuergen Gross <jgross@suse.com>
Fri, 5 Dec 2025 07:46:07 +0000 (08:46 +0100)
commit150215b89bcf708356abcb7d3cafdd1e6068598b
tree9854932e42207e346568148a1a7d56b2b084c041
parenta73d4a055622d0973e371382b16a13f9795ffec7
drivers/xen: use min() instead of min_t()

min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
and so cannot discard significant bits.

In this case the 'unsigned long' value is small enough that the result
is ok.

Detected by an extra check added to min_t().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20251119224140.8616-30-david.laight.linux@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/grant-table.c