]> git.ipfire.org Git - thirdparty/linux.git/commit
char/adi: Use min_t(size_t,,) in adi_read() + adi_write()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 8 Sep 2025 18:13:54 +0000 (20:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Oct 2025 05:53:49 +0000 (07:53 +0200)
commitf50d2dcd1a2a0a8c959f9d6fd1dafa78954086f4
tree5c96bef446464f94de4ce396972860b7890ee662
parent47f1a2acee55a116dfd1daff7ee37cc4ff5fa5ed
char/adi: Use min_t(size_t,,) in adi_read() + adi_write()

Replace min() and manual casting of MAX_BUF_SZ with min_t(size_t,,) in
both adi_read() and adi_write().

This matches the initial buffer size calculation:

ver_buf_sz = min_t(size_t, count, MAX_BUF_SZ);

and makes the code more consistent. No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250908181354.436680-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/adi.c