All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/x86/kernel/unwind_orc.c:212:16-17: WARNING opportunity for swap()
@ 2021-07-29 23:45 kernel test robot
  2021-07-29 23:46 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-07-29 23:45 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1035 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:   7e96bf476270aecea66740a083e51b38c1371cd2
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
date:   3 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-c002-20210728 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.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/x86/kernel/unwind_orc.c:212:16-17: 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: 38587 bytes --]

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

* [PATCH] coccinelle: misc: fix swap.cocci warnings
  2021-07-29 23:45 arch/x86/kernel/unwind_orc.c:212:16-17: WARNING opportunity for swap() kernel test robot
@ 2021-07-29 23:46 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-07-29 23:46 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1924 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: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
CC: Borislav Petkov <bp@alien8.de>
CC: x86(a)kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Josh Poimboeuf <jpoimboe@redhat.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Miroslav Benes <mbenes@suse.cz>

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

arch/x86/kernel/unwind_orc.c:212:16-17: 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:   7e96bf476270aecea66740a083e51b38c1371cd2
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
:::::: branch date: 7 hours ago
:::::: commit date: 3 months ago

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

 unwind_orc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -196,7 +196,6 @@ static struct orc_entry *cur_orc_table =
 static void orc_sort_swap(void *_a, void *_b, int size)
 {
 	struct orc_entry *orc_a, *orc_b;
-	struct orc_entry orc_tmp;
 	int *a = _a, *b = _b, tmp;
 	int delta = _b - _a;
 
@@ -208,9 +207,7 @@ static void orc_sort_swap(void *_a, void
 	/* Swap the corresponding .orc_unwind entries: */
 	orc_a = cur_orc_table + (a - cur_orc_ip_table);
 	orc_b = cur_orc_table + (b - cur_orc_ip_table);
-	orc_tmp = *orc_a;
-	*orc_a = *orc_b;
-	*orc_b = orc_tmp;
+	swap(*orc_a, *orc_b);
 }
 
 static int orc_sort_cmp(const void *_a, const void *_b)

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

* arch/x86/kernel/unwind_orc.c:212:16-17: WARNING opportunity for swap()
@ 2021-11-27 18:45 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-11-27 18:45 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1093 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:   c5c17547b778975b3d83a73c8d84e8fb5ecf3ba5
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
date:   7 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 7 months ago
config: x86_64-randconfig-c023-20211126 (https://download.01.org/0day-ci/archive/20211128/202111280236.BjrkRXA9-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.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/x86/kernel/unwind_orc.c:212:16-17: 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

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

end of thread, other threads:[~2021-11-27 18:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 23:45 arch/x86/kernel/unwind_orc.c:212:16-17: WARNING opportunity for swap() kernel test robot
2021-07-29 23:46 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-11-27 18:45 arch/x86/kernel/unwind_orc.c:212:16-17: WARNING opportunity for swap() 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.