video: fbdev: sis: use swap() to make code cleaner
authorYang Guang <yang.guang5@zte.com.cn>
Sat, 18 Dec 2021 01:56:59 +0000 (09:56 +0800)
committerHelge Deller <deller@gmx.de>
Sat, 29 Jan 2022 21:24:25 +0000 (22:24 +0100)
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/sis/sis_main.c

index 266a558..742f629 100644 (file)
@@ -213,7 +213,7 @@ static void sisfb_search_mode(char *name, bool quiet)
                /* 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;
+                               swap(rate, depth);
                        }
                        sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
                        nameptr = strbuf;