CC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Thomas Winischhofer <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/video/fbdev/sis/sis_main.c:216:26-27: 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:   bbdff6d583be718935b613ab2a966cddaadf661f
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap 
script
:::::: branch date: 3 hours ago
:::::: commit date: 7 months ago

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

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

--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -212,9 +212,9 @@ static void sisfb_search_mode(char *name
 
                /* This does some fuzzy mode naming detection */
                if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) 
== 4) {
-                       if((rate <= 32) || (depth > 32)) {
-                               j = rate; rate = depth; depth = j;
-                       }
+                       if((rate <= 32) || (depth > 32))
+                               
+                               swap(rate, depth);
                        sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
                        nameptr = strbuf;
                        sisfb_parm_rate = rate;
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to