]> git.ipfire.org Git - thirdparty/linux.git/commit
staging: gpib: Use min for calculating transfer length
authorDave Penkler <dpenkler@gmail.com>
Mon, 20 Jan 2025 14:50:30 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Feb 2025 15:06:30 +0000 (16:06 +0100)
commit76d54fd5471b10ee993c217928a39d7351eaff5c
treeb665764c541ad3fefa189314b27ed2e61a7dfaf6
parent8e4d3729efb4e4716cb12a25e06dbe40f1a0191f
staging: gpib: Use min for calculating transfer length

In the accel read and write functions the transfer length
was being calculated by an if statement setting it to
the lesser of the remaining bytes to read/write and the
fifo size.

Replace both instances with min() which is clearer and
more compact.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202501182153.qHfL4Fbc-lkp@intel.com/
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250120145030.29684-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/agilent_82350b/agilent_82350b.c