From patchwork Wed Nov 10 05:56:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 1553247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hSmPdmhj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XlQVpXP5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HpvH12CcLz9s5P for ; Wed, 10 Nov 2021 16:56:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PdEYf0HX7WFpzNfGAWVbG7CytJro/csoQuwos6GXLxc=; b=hSmPdmhj7EgWf5 AN8m98TEMREhvSUi+VweIPdQTzcTbXADul2oTDm8wexKTQoZ1Z6AyfVF5qEgAqs/38D0xgNaIN40y rtKfbcoaZRaWGHhWkOnIpXFlP7nHfYUx4jLEEkecdDcGkn3TEu+W2Cih7kambAxgfR23DtqbQGsgX wBLqMPh7FU5uGtnVY5xustwnkc0XzEnQXCBMHlII220Lt84s6YiGmc+S3mlIFzSBaa4rZKAKbJhVq lCgdQfDFdZ3H9uAVo/XykoWIYvlgACU4dOCEf5Ur3yawAz72+2oOPq/R8buBm1A4OgjpoUcFQe4Y+ af/p/kFpM1jZGq2xz3Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkgah-004WYE-36; Wed, 10 Nov 2021 05:56:11 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkgac-004WWb-T6 for linux-snps-arc@lists.infradead.org; Wed, 10 Nov 2021 05:56:09 +0000 Received: by mail-pj1-x102e.google.com with SMTP id o6-20020a17090a0a0600b001a64b9a11aeso706776pjo.3 for ; Tue, 09 Nov 2021 21:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c9xw6yStoEfjNF/k/c5MSuaBqDAKe3MzsJwqL/ZdYgc=; b=XlQVpXP5KFDNPVOZeglwkgCyknPZBl3oT7RZ1fVhOkxWg5a3gb+QtthfUsGOrkkxVj zRlNlZd7mCGzlmrZT+TulVMkBx/3iuHdvvWvfBHnlLk4EbZmgPH+oFgtBivGlpO981x2 ytw7RyD8PAuzcfuKkG6t9zobJgBGh4e4PQVyE4pmAU+heGqcZhlDEr+gNPXssCEsbUow eZV8NzHXGrHpXruAS48J8qQRfhgISkQvZtR89q3cUrAjv3+xiQmkOYvtSqfEPAzMrLWn g9VTlS8d0u1NwobesDguiBSCrO9a66syJypi+UYDZQjgQ8sCVAu6lSIOSxjPQzSVb98B UUUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c9xw6yStoEfjNF/k/c5MSuaBqDAKe3MzsJwqL/ZdYgc=; b=I43S71zYgUL4MgrRzBdmawxNozocf+XowV/RW1QVokzGvTRHaVVUSqOyIrJnvPrtZ6 FXXeP7Ak4G+D38Yw5iwCpeKslYAMEWFVXxAefg0K7+RWMNxhIIEgHcA6iQgfTu8XFKZj pWq4OeeMqzn4sn0iUkAzblpJOokJgqy0tjSHn/GQNoJl/AnSfqJj4X7Ox8r5xurrLbsB PWctPbOtvXmsai/cdnChjmKx0FLLmItxhFhXNSUtc2vmMaEgA0SOu2pou5q8lU2RrZs6 QkHRmyod8B9aIUiaWc/Z4n1XoRv/CeMMbaL/4iamVFeYoATpFGTqLja3xDElVegZv6hn uHQQ== X-Gm-Message-State: AOAM531DjSlvAWFKkLAJMQikdsapLNnkXcaimYK4httkVAVkaUuUdcp1 yCpW+on8D1bOQ5SIGDNmsX4= X-Google-Smtp-Source: ABdhPJz0c2CtPUQNTmZOFwIt15jaN5bVclSWRFjEanbxNjbhmANpafrdj1T9Z4DwTQZv0PvVl5TCQA== X-Received: by 2002:a17:90b:4a83:: with SMTP id lp3mr14134601pjb.242.1636523766394; Tue, 09 Nov 2021 21:56:06 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id b1sm17504691pff.89.2021.11.09.21.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 21:56:06 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: ye.guojin@zte.com.cn To: vgupta@kernel.org Cc: ye.guojin@zte.com.cn, yangdianqing@yulong.com, wjc@cdjrlc.com, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Zeal Robot Subject: [PATCH] ARC: dw2 unwind: use swap() to make code cleaner Date: Wed, 10 Nov 2021 05:56:02 +0000 Message-Id: <20211110055602.136926-1-ye.guojin@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_215606_993397_57406C66 X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ye Guojin This was found by coccicheck: ./arch/arc/kernel/unwind.c, 251, 22-23, WARNING opportunity for swap() ./arch/arc/kernel/unwind.c, 254, 18-19, WARNING opportunity for swap() Addtionally, adjust the sequence of header files to be arranged in alphabetical order. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cgel.zte[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ye Guojin This was found by coccicheck: ./arch/arc/kernel/unwind.c, 251, 22-23, WARNING opportunity for swap() ./arch/arc/kernel/unwind.c, 254, 18-19, WARNING opportunity for swap() Addtionally, adjust the sequence of header files to be arranged in alphabetical order. Reported-by: Zeal Robot Signed-off-by: Ye Guojin --- arch/arc/kernel/unwind.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 9e28058cdba8..ea795304982a 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -10,17 +10,18 @@ * is not much point in implementing the full Dwarf2 unwind API. */ -#include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include extern char __start_unwind[], __end_unwind[]; /* extern const u8 __start_unwind_hdr[], __end_unwind_hdr[];*/ @@ -245,14 +246,9 @@ static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size) { struct eh_frame_hdr_table_entry *e1 = p1; struct eh_frame_hdr_table_entry *e2 = p2; - unsigned long v; - - v = e1->start; - e1->start = e2->start; - e2->start = v; - v = e1->fde; - e1->fde = e2->fde; - e2->fde = v; + + swap(e1->start, e2->start); + swap(e1->fde, e2->fde); } static void init_unwind_hdr(struct unwind_table *table,