CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Dmitry Torokhov <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/input/joystick/adi.c:395:13-14: 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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

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

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

 drivers/input/joystick/adi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -392,7 +392,7 @@ static int adi_init_input(struct adi *ad
        if (!input_dev)
                return -ENOMEM;
 
-       t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
+       t = min(adi->id, ADI_ID_MAX);
 
        snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id);
        snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, 
adi->cname);
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to