[<prev] [next>] [day] [month] [year] [list]
Message-Id: <81d101e615dcd8cc661272965a6a3a51d77aa491.1639791676.git.yang.guang5@zte.com.cn>
Date: Sat, 18 Dec 2021 09:56:59 +0800
From: davidcomponentone@...il.com
To: thomas@...ischhofer.net
Cc: davidcomponentone@...il.com, dri-devel@...ts.freedesktop.org,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Yang Guang <yang.guang5@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] video: fbdev: use swap() to make code cleaner
From: Yang Guang <yang.guang5@....com.cn>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
drivers/video/fbdev/sis/sis_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 266a5582f94d..742f62986b80 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -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;
--
2.30.2
Powered by blists - more mailing lists