CC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Evgeniy Polyakov <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>
CC: Dan Carpenter <[email protected]>
CC: Bhaskar Chowdhury <[email protected]>
CC: Ivan Zaentsev <[email protected]>
CC: Randy Dunlap <[email protected]>
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/w1/slaves/w1_therm.c:1840:18-19: 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:   6f513529296fd4f696afb4354c46508abe646541
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap 
script
:::::: branch date: 13 hours ago
:::::: commit date: 7 months ago

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

 w1_therm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -1836,9 +1836,9 @@ static ssize_t alarms_store(struct devic
        th = int_to_short(temp);
 
        /* Reorder if required th and tl */
-       if (tl > th) {
-               tt = tl; tl = th; th = tt;
-       }
+       if (tl > th)
+               
+               swap(tl, th);
 
        /*
         * Read the scratchpad to change only the required bits
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to