From patchwork Thu May 18 11:08:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 95801 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp416654vqo; Thu, 18 May 2023 04:28:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7inojtmg4+O8qWpUrT6Vn8z1UvKd/eAmHaCgNa7m/WOB6Mja8eBeRr9TKwHAayB60pCQLd X-Received: by 2002:a17:90b:1983:b0:24d:f816:7952 with SMTP id mv3-20020a17090b198300b0024df8167952mr2293017pjb.5.1684409334877; Thu, 18 May 2023 04:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684409334; cv=none; d=google.com; s=arc-20160816; b=wPCy4tzuINI+isE7lDOLqi8OWR1516+4b9g8ldV905Oziy3nQQIrrFX0ynPYaJRPIr qGpj0yH/0k/aeJVcs5okiKAzfi4BuZLY1IsBX0o2X6Xy5dQcsELQzMpGGNxhq3yud5wI 3c+zssJc0sBNHGT1QFKB/F+Cz4GQA/IL119LxowWTfW0YvQz5y59HzsG3YGUTM5HInm6 ic28GCE/VkcFXYNN8be5NpkljX5/CpfkpWlTd40LyhkjZnzI8YTzYAupgaec+OWMvafU WztU0Oto11W0Ukc3WFL4TiJE8kriqf7Pbh7fQPT8hvh5kegb0i0RsBBQUEGq9SXI5tkF G3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=DDrie1cOrSTy8hqwWcIdLpLvCM2cPcYwzeoDx6sC2kg=; b=C98FX+apdp6iWBofVm7950EL+GhnO/QAGBGleAXqrLs82w6TZaiuLx4STwLGvdXuUd XPa70tRHWlQataS3OSdzQt+Mjp+mImS6gMtPUv4UWcFxL/yqNjpz8kUcMpO93PSa0pqv M7+z5yOhsRxhw6drhwlsV0+YS0AU30qSVfHnDA3SoQtqNS44mlF8VkIhI8+bAHqSU8tT 51lL88F3g5JFb6jm8lkzEJ4SHt/5I2VAnnZe3wz9NAHNOGnUysterHnmyj1Jb9SGH7/a Yehc0JfLbBH9guo+iMyUrbL80t1iDFOYhkS4aoYwtDX4W9Ap61IcD5INreMtq6Asn/aB TGmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=El1p1inT; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl13-20020a17090b120d00b00251e16303f2si1477248pjb.86.2023.05.18.04.28.42; Thu, 18 May 2023 04:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=El1p1inT; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjERLJb (ORCPT + 99 others); Thu, 18 May 2023 07:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjERLJS (ORCPT ); Thu, 18 May 2023 07:09:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601D32683; Thu, 18 May 2023 04:08:37 -0700 (PDT) Date: Thu, 18 May 2023 11:08:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684408084; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DDrie1cOrSTy8hqwWcIdLpLvCM2cPcYwzeoDx6sC2kg=; b=El1p1inTGcqDn7LQQLop654NpQp8sIv4EyD0MgnMLD2KfsTVq9Ys3n/8TVhMs7q58PLzD7 fN/luGBHV2j6jW/se2dXHAbWTisVl+NgQped5FGrsbObBfRf1Nkx6Cf+jwQokIid6U4YC9 dIS06ngrVKmioHnwBU8s8yONaVSjVE5TxcvpJFvI7ot5WHaCASWMdlJYWdVY2S6DXCIiHB LjsxOsFF7kgRQ5om1F3cRnY/QDkxOsSj0HZ2JWKdGg3MQ5kTyD8mzJTmYTvojDFxznitlb cbH1QMEKai1bYlZvwhsYg7q5nWKK3kTDVcn9tWNRq9d4HUxB4LN6P5sWMz+iRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684408084; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DDrie1cOrSTy8hqwWcIdLpLvCM2cPcYwzeoDx6sC2kg=; b=SULRuuQB232AlMs0oNflsT5tfyr2/NpfuPDHIeb2uVNnU2/hdqWw08NrhyMUOLQBw4zHM7 MHZbwX3a21crwFCw== From: "tip-bot2 for Jiapeng Chong" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] x86/unwind/orc: Use swap() instead of open coding it Cc: Abaci Robot , Jiapeng Chong , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230330020014.40489-1-jiapeng.chong@linux.alibaba.com> References: <20230330020014.40489-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Message-ID: <168440808427.404.1399705978286968537.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761758629847618652?= X-GMAIL-MSGID: =?utf-8?q?1766231203105654682?= 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 AuthorDate: Thu, 30 Mar 2023 10:00:14 +08:00 Committer: Josh Poimboeuf 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 Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4641 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230330020014.40489-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Josh Poimboeuf --- 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)