From: "tip-bot2 for Jiapeng Chong" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Abaci Robot <abaci@linux.alibaba.com>,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: objtool/core] x86/unwind/orc: Use swap() instead of open coding it
Date: Thu, 18 May 2023 11:08:04 -0000 [thread overview]
Message-ID: <168440808427.404.1399705978286968537.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230330020014.40489-1-jiapeng.chong@linux.alibaba.com>
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 95f0e3a209b0045a56a06987d85981280f523270
Gitweb: https://git.kernel.org/tip/95f0e3a209b0045a56a06987d85981280f523270
Author: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
AuthorDate: Thu, 30 Mar 2023 10:00:14 +08:00
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Tue, 16 May 2023 06:06:56 -07:00
x86/unwind/orc: Use swap() instead of open coding it
Swap is a function interface that provides exchange function. To avoid
code duplication, we can use swap function.
./arch/x86/kernel/unwind_orc.c:235:16-17: WARNING opportunity for swap().
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4641
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230330020014.40489-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
arch/x86/kernel/unwind_orc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index 3ac50b7..5fbcb22 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -219,7 +219,6 @@ static struct orc_entry *cur_orc_table = __start_orc_unwind;
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;
@@ -231,9 +230,7 @@ static void orc_sort_swap(void *_a, void *_b, int size)
/* 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)
prev parent reply other threads:[~2023-05-18 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 2:00 [PATCH] " Jiapeng Chong
2023-05-18 11:08 ` tip-bot2 for Jiapeng Chong [this message]
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=168440808427.404.1399705978286968537.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=abaci@linux.alibaba.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®