From: Changcheng Deng Date: Thu, 28 Oct 2021 11:08:47 +0000 (+0000) Subject: video: fbmem: use swap() to make code cleaner in fb_rotate_logo() X-Git-Tag: v6.1-rc5~1764^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a786596954a81c293d0419151e7729a1d91a183;p=platform%2Fkernel%2Flinux-starfive.git video: fbmem: use swap() to make code cleaner in fb_rotate_logo() Use swap() in order to make code cleaner. Issue found by coccinelle. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Helge Deller --- diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 0fa7ede..2966da1 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;