CC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Pavel Machek <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/leds/leds-tca6507.c:246:14-15: WARNING opportunity for swap()


 Check for opencoded swap() implementation.

Generated by: scripts/coccinelle/misc/swap.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:   5833291ab6de9c3e2374336b51c814e515e8f3a5
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap 
script
:::::: branch date: 11 hours ago
:::::: commit date: 7 months ago

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

 leds-tca6507.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -241,11 +241,9 @@ static int choose_times(int msec, int *c
        }
        if (diff < 65536) {
                int actual;
-               if (msec & 1) {
-                       c1 = *c2p;
-                       *c2p = *c1p;
-                       *c1p = c1;
-               }
+               if (msec & 1)
+                       
+                       swap(*c2p, *c1p);
                actual = time_codes[*c1p] + time_codes[*c2p];
                if (*c1p < *c2p)
                        return actual + 1;
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to