* [PATCH l] fbdev: fbmem: use swap() to make code cleaner
@ 2021-10-28 11:08 cgel.zte
0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2021-10-28 11:08 UTC (permalink / raw)
To: daniel.vetter
Cc: sam, willy, deng.changcheng, thunder.leizhen, jgg,
penguin-kernel, zheyuma97, xiyuyang19, dri-devel, linux-fbdev,
linux-kernel, Zeal Robot
From: Changcheng Deng <deng.changcheng@zte.com.cn>
Use swap() in order to make code cleaner. Issue found by coccinelle.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
drivers/video/fbdev/core/fbmem.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 826175ad88a2..2c8e6feef0c9 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -396,18 +396,14 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst,
} else if (rotate == FB_ROTATE_CW) {
fb_rotate_logo_cw(image->data, dst, image->width,
image->height);
- tmp = image->width;
- image->width = image->height;
- image->height = tmp;
+ swap(image->width, image->height);
tmp = image->dy;
image->dy = image->dx;
image->dx = info->var.xres - image->width - tmp;
} else if (rotate == FB_ROTATE_CCW) {
fb_rotate_logo_ccw(image->data, dst, image->width,
image->height);
- tmp = image->width;
- image->width = image->height;
- image->height = tmp;
+ swap(image->width, image->height);
tmp = image->dx;
image->dx = image->dy;
image->dy = info->var.yres - image->height - tmp;
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-28 11:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 11:08 [PATCH l] fbdev: fbmem: use swap() to make code cleaner cgel.zte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.