All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/parisc/mm/init.c:138:36-37: WARNING opportunity for swap()
@ 2021-08-30 12:52 kernel test robot
  2021-08-30 12:52 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-08-30 12:52 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7d2a07b769330c34b4deabeed939325c77a7ec2f
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
date:   4 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 4 months ago
config: parisc-randconfig-c023-20210829 (attached as .config)
compiler: hppa-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> arch/parisc/mm/init.c:138:36-37: WARNING opportunity for swap()

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34367 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] coccinelle: misc: fix swap.cocci warnings
  2021-08-30 12:52 arch/parisc/mm/init.c:138:36-37: WARNING opportunity for swap() kernel test robot
@ 2021-08-30 12:52 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-08-30 12:52 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
CC: Helge Deller <deller@gmx.de>
CC: Nick Desaulniers <ndesaulniers@gooogle.com>
CC: Russell King <rmk+kernel@armlinux.org.uk>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: Christophe Leroy <christophe.leroy@c-s.fr>
CC: Mike Rapoport <rppt@kernel.org>
CC: Joe Perches <joe@perches.com>

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

arch/parisc/mm/init.c:138:36-37: WARNING opportunity for swap()


 Check for opencoded swap() implementation.

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

CC: Denis Efremov <efremov@linux.com>
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/torvalds/linux.git master
head:   7d2a07b769330c34b4deabeed939325c77a7ec2f
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
:::::: branch date: 15 hours ago
:::::: commit date: 4 months ago

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

 init.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -134,9 +134,7 @@ static void __init setup_bootmem(void)
 
 				break;
 			}
-			tmp = pmem_ranges[j-1];
-			pmem_ranges[j-1] = pmem_ranges[j];
-			pmem_ranges[j] = tmp;
+			swap(pmem_ranges[j - 1], pmem_ranges[j]);
 		}
 	}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-30 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 12:52 arch/parisc/mm/init.c:138:36-37: WARNING opportunity for swap() kernel test robot
2021-08-30 12:52 ` [PATCH] coccinelle: misc: 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.