CC: kbuild-...@lists.01.org
BCC: l...@intel.com
CC: linux-ker...@vger.kernel.org
TO: Denis Efremov <efre...@linux.com>
CC: Julia Lawall <julia.law...@inria.fr>
CC: Alan Stern <st...@rowland.harvard.edu>
CC: "Greg Kroah-Hartman" <gre...@linuxfoundation.org>
CC: linux-...@vger.kernel.org
CC: usb-stor...@lists.one-eyed-alien.net
CC: linux-ker...@vger.kernel.org

From: kernel test robot <l...@intel.com>

drivers/usb/storage/realtek_cr.c:264:20-21: WARNING opportunity for min()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

CC: Denis Efremov <efre...@linux.com>
Reported-by: kernel test robot <l...@intel.com>
Signed-off-by: kernel test robot <l...@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   56e337f2cf1326323844927a04e9dbce9a244835
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax 
script
:::::: branch date: 24 hours ago
:::::: commit date: 11 months ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/usb/storage/realtek_cr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -261,7 +261,7 @@ static int rts51x_bulk_transport(struct
         * was really transferred and what the device tells us
         */
        if (residue)
-               residue = residue < buf_len ? residue : buf_len;
+               residue = min(residue, buf_len);
 
        if (act_len)
                *act_len = buf_len - residue;
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to