All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] coccinelle: misc: fix swap.cocci warnings
Date: Sun, 28 Nov 2021 02:42:56 +0800	[thread overview]
Message-ID: <20211127184256.GA3051@3e28b18dce75> (raw)

[-- Attachment #1: Type: text/plain, Size: 1925 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:   c5c17547b778975b3d83a73c8d84e8fb5ecf3ba5
commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap script
:::::: branch date: 22 hours ago
:::::: commit date: 7 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)

             reply	other threads:[~2021-11-27 18:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 18:42 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-08 17:43 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-02-08 17:35 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-02-07 11:12 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-02-07 11:05 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-02-01 20:12 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-02-01 20:02 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-31 12:17 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-31 12:13 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-28  7:28 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-28  7:19 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-28  4:50 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-28  4:40 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-25 12:39 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-25 12:34 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-23  2:36 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-23  2:27 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-22 20:15 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-22 18:27 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-20 16:24 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-20 16:15 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-19  9:01 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-19  8:55 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2022-01-18 11:13 lib/bch.c:842:7-8: WARNING opportunity for swap() kernel test robot
2022-01-18  8:17 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-12-31 17:42 kernel test robot
2021-12-16 14:00 kernel test robot
2021-12-13 17:02 kernel test robot
2021-12-12  0:37 kernel test robot
2021-12-11 14:08 kernel test robot
2021-12-07 10:15 kernel test robot
2021-11-13 12:20 arch/arc/kernel/unwind.c:251:22-23: WARNING opportunity for swap() kernel test robot
2021-11-13 12:20 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-11-12 10:32 drivers/leds/leds-tca6507.c:246:14-15: WARNING opportunity for swap() kernel test robot
2021-11-12 10:32 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-11-11 20:49 arch/um/os-Linux/sigio.c:81:28-29: WARNING opportunity for swap() kernel test robot
2021-11-11 20:49 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-09-03 14:17 arch/ia64/kernel/setup.c:213:39-40: WARNING opportunity for swap() kernel test robot
2021-09-03 14:17 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
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
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-07-18 19:14 arch/arc/kernel/unwind.c:251:22-23: WARNING opportunity for swap() kernel test robot
2021-07-18 19:14 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-07-13 23:10 drivers/net/ethernet/sfc/efx_channels.c:804:36-37: WARNING opportunity for swap() kernel test robot
2021-07-13 23:11 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot
2021-07-07 22:21 fs/xfs/libxfs/xfs_da_btree.c:898:15-16: WARNING opportunity for swap() kernel test robot
2021-07-07 22:21 ` [PATCH] coccinelle: misc: fix swap.cocci warnings kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211127184256.GA3051@3e28b18dce75 \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.