All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fbdev: fix swap.cocci warnings
@ 2021-12-08 23:52 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-12-08 23:52 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1980 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Arnd Bergmann <arnd@arndb.de>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/core/fb_logo.c:225:30-31: WARNING opportunity for swap()
drivers/video/fbdev/core/fb_logo.c:234:30-31: WARNING opportunity for swap()


 Check for opencoded swap() implementation.

Generated by: scripts/coccinelle/misc/swap.cocci

Fixes: 8bbaa3711d10 ("fbdev: move logo code into separate file")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git randconfig-5.17-next
head:   fdcc9acc26de65e7b1b8cebc3089b7666be25681
commit: 8bbaa3711d100f22e3211cc2c223f7e62d4ba50b [132/205] fbdev: move logo code into separate file
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago

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

 fb_logo.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/drivers/video/fbdev/core/fb_logo.c
+++ b/drivers/video/fbdev/core/fb_logo.c
@@ -221,18 +221,14 @@ static void fb_rotate_logo(struct fb_inf
 	} 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-08 23:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 23:52 [PATCH] fbdev: fix swap.cocci warnings kernel test robot

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.