Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp799014rwd; Thu, 18 May 2023 04:14:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g52RWF22rONNKjfGI3vE6C9fQgwWQi4Hj6cDsvyRBVenMikN/vJYFx8+xdCQpkG9RErXZ X-Received: by 2002:a05:6a00:1487:b0:627:6328:79f1 with SMTP id v7-20020a056a00148700b00627632879f1mr3657575pfu.34.1684408487953; Thu, 18 May 2023 04:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684408487; cv=none; d=google.com; s=arc-20160816; b=tmMq9SDBK/wmovwN8rO/b2ivbekM0PHD3eP6zbiEx2W7LKF2bedWgWS387JYFPov/x JJwjRYnrvBZ+H8YwpmVk3p6YnVPPPrPIT6udPVTpb1D2Oj6f83M+w8n24I9/fCXpcuqh yjvP0QpigV50KhmvyFHjojiaDKJ3lMIeIIhd8eqelBNn75GhWsUj2tJO6wgWdyeB9Cv3 Bq7zF8BKVVxb5ye8vd+xQK2zcLroG+AoqHd3b9I6tB/GgHWLN9GollqOyDhHtPIyFrN+ 9ltL4Gi91IxKsa9cG5KxSgM/cXl4riX4HLSvMdOPSD4MQgibd3PyYUc1xBp+66GEydhE vzUw== 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 header.s=2020e header.b=SULRuuQB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a637457000000b00513234112acsi1188899pgn.888.2023.05.18.04.14.32; Thu, 18 May 2023 04:14:47 -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 header.s=2020e header.b=SULRuuQB; 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 S231252AbjERLJb (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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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)