From patchwork Sat Mar 30 16:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1070936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GX8T/xPg"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="XQbJE7yQ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Wkr41X7Qz9sRf for ; Sun, 31 Mar 2019 03:40:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/Dyf71imDaekWRY/LV8muRwUF7O7bDKDoRYYoBY4dfM=; b=GX8T/xPg1ZqEou gz4PYRtVXRXPhZwYM7cZ7UuBPhAujx0ay7AVGU89Zx+mPm8Nk312dWzTCeDFNL4GVL6+zSkQfc9bH tR8bmlhJNzUs6+VqiyW+0gcVEdFdt+5tNobkobd/5bR1DXOUcpgXki4h1t7TK+1BhZVKPt3YGkJCs 5efY4Zdi7o12PCaP+mlBYqRQNGaTjDbThW87SqRo1YwcGqB0Klj0MbRMyHY3rE6LTmpUd3dDXSO13 xYRH4xXMfpuvI6z42efjGvFrdFbNrY+S2860WYtQmZuOJCJYPBO84Nms8G/XXrptmr3ff/TiQ/97w 0JDNXKAdABs+ukVrfaCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH2H-0003Wu-Ob; Sat, 30 Mar 2019 16:40:49 +0000 Received: from forward501o.mail.yandex.net ([37.140.190.203]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH29-0003Nx-A2; Sat, 30 Mar 2019 16:40:43 +0000 Received: from mxback21g.mail.yandex.net (mxback21g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:321]) by forward501o.mail.yandex.net (Yandex) with ESMTP id 1458A1E80077; Sat, 30 Mar 2019 19:40:32 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback21g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ppVQJ39iEk-eObCmM4j; Sat, 30 Mar 2019 19:40:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1553964031; bh=wUFI0A/Hfi2T5Xw16erqiqcqWUAYT1HNRh6fD4qBsQ0=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=XQbJE7yQ6mIuKw2yugAYZR4wXvmTRE+PODfLC6c8Gx/2w5sW5SVvbS5WFC7jygiey PvB7DrToo02sJhGmCMZKW4gTBCVJ+nZV6g/Z6kOFe/+WAciTXjjpfCtCNX+cTC/IAl Ds7vDi7SOO1L7UjXwrnzuz24o1XzlbE5kl1t48No= Authentication-Results: mxback21g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt2-dc4bba9bb23c.qloud-c.yandex.net with HTTP; Sat, 30 Mar 2019 19:40:24 +0300 From: Andrey Abramov To: "vgupta@synopsys.com" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "mark@fasheh.com" , "jlbec@evilplan.org" , "richard@nod.at" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "gregkh@linuxfoundation.org" , "naveen.n.rao@linux.vnet.ibm.com" , "jpoimboe@redhat.com" , Dave Chinner , "darrick.wong@oracle.com" , "ard.biesheuvel@linaro.org" , George Spelvin , "linux-snps-arc@lists.infradead.org" , Linux Kernel Mailing List , "linuxppc-dev@lists.ozlabs.org" , "ocfs2-devel@oss.oracle.com" , "linux-mtd@lists.infradead.org" , "sfr@canb.auug.org.au" In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> Subject: [PATCH 1/5] arch/arc: unwind.c: replace swap function with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 30 Mar 2019 19:40:24 +0300 Message-Id: <20170071553964024@myt2-dc4bba9bb23c.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_094041_903958_80518ECB X-CRM114-Status: UNSURE ( 6.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [37.140.190.203 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mhocko@suse.com" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "amir73il@gmail.com" , Rasmus Villemoes , "kamalesh@linux.vnet.ibm.com" , "piaojun@huawei.com" , "yamada.masahiro@socionext.com" , "jiang.biao2@zte.com.cn" , "jslaby@suse.cz" , "yuehaibing@huawei.com" , "rppt@linux.ibm.com" , "ge.changwei@h3c.com" , "keescook@chromium.org" , "jannh@google.com" , "ashish.samant@oracle.com" , "npiggin@gmail.com" , "jiangyiwen@huawei.com" , Andy Shevchenko , "lchen@suse.com" , "malat@debian.org" , Morton Andrew Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace swap_eh_frame_hdr_table_entries with built-in one, because swap_eh_frame_hdr_table_entries does a simple byte to byte swap. Signed-off-by: Andrey Abramov --- arch/arc/kernel/unwind.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 271e9fafa479..7610fe84afea 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -248,20 +248,6 @@ static int cmp_eh_frame_hdr_table_entries(const void *p1, const void *p2) return (e1->start > e2->start) - (e1->start < e2->start); } -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; -} - static void init_unwind_hdr(struct unwind_table *table, void *(*alloc) (unsigned long)) { @@ -354,10 +340,8 @@ static void init_unwind_hdr(struct unwind_table *table, } WARN_ON(n != header->fde_count); - sort(header->table, - n, - sizeof(*header->table), - cmp_eh_frame_hdr_table_entries, swap_eh_frame_hdr_table_entries); + sort(header->table, n, + sizeof(*header->table), cmp_eh_frame_hdr_table_entries, NULL); table->hdrsz = hdrSize; smp_wmb(); From patchwork Sat Mar 30 16:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1070938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Lzm2G2tG"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="r2yLcjas"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44WksG4JJqz9sRf for ; Sun, 31 Mar 2019 03:41:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yN9TNmm672MW7sKxfHX5DRLERBlf3l6m6GdLfMzeIjY=; b=Lzm2G2tGh5sQHq a0qB63I/61JtyKTHUp2MnzH3W5Bbt81MezqFJ9doOLj+TRnLIik4vwO+Xt8daZxViQxQoZVZXkTwy ksUlcfbdXPmqQQG1MrIQ057ohgt9wsCU/0YNgB4KBpMdQdIkWs+yK8EQZvZ8oB93uwWS8ClUqvt4x Yfbj7l1ri9WNUmL/ozLj/atZNDlE70NQ76ZQMZHRbYbEqgytrzb4TBucGr0W5t+Ibcuc/d6hc7YHp 3SHt2/hEotWXZxU+ZuFs7wo7JL5qvkuAqL0AUQg4Uf4jzZLl6FNCqRaMfZbOIows6v+7JIgXOCjM2 o9wH/KK3hI4l2ZnbVN4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH3I-0003nm-8E; Sat, 30 Mar 2019 16:41:52 +0000 Received: from forward501j.mail.yandex.net ([5.45.198.251]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH39-0003eJ-D6; Sat, 30 Mar 2019 16:41:45 +0000 Received: from mxback15o.mail.yandex.net (mxback15o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::66]) by forward501j.mail.yandex.net (Yandex) with ESMTP id 0A0063380055; Sat, 30 Mar 2019 19:41:38 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback15o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FwYt6bfWhz-fUuGwdtu; Sat, 30 Mar 2019 19:41:37 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1553964097; bh=BAGuq6aY41vQoMTVybblCDo6g+wTKuB5ZkNrCMXNEeI=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=r2yLcjasL66jIafN59BUK+sNyksLUyMg6rcLPmogPy/2DlS0P/jSubx07PiOJqTv4 UrX91bPScueQ2KihFcebl6F7npigS0F0/mtjTfsIKZ3lZYvTmqBZ1MzsKkxVLCINhx CLR56e2I5oHl+LwxkL8NnPLdj6sMk5V+40LdDaG8= Authentication-Results: mxback15o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva7-8a22bc446c12.qloud-c.yandex.net with HTTP; Sat, 30 Mar 2019 19:41:30 +0300 From: Andrey Abramov To: "vgupta@synopsys.com" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "mark@fasheh.com" , "jlbec@evilplan.org" , "richard@nod.at" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "gregkh@linuxfoundation.org" , "naveen.n.rao@linux.vnet.ibm.com" , "jpoimboe@redhat.com" , Dave Chinner , "darrick.wong@oracle.com" , "ard.biesheuvel@linaro.org" , George Spelvin , "linux-snps-arc@lists.infradead.org" , Linux Kernel Mailing List , "linuxppc-dev@lists.ozlabs.org" , "ocfs2-devel@oss.oracle.com" , "linux-mtd@lists.infradead.org" , "sfr@canb.auug.org.au" In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> Subject: [PATCH 2/5] powerpc: module_[32|64].c: replace swap function with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 30 Mar 2019 19:41:30 +0300 Message-Id: <21287961553964090@iva7-8a22bc446c12.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_094143_814434_7BF4DCEB X-CRM114-Status: UNSURE ( 6.60 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [5.45.198.251 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mhocko@suse.com" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "amir73il@gmail.com" , Rasmus Villemoes , "kamalesh@linux.vnet.ibm.com" , "piaojun@huawei.com" , "yamada.masahiro@socionext.com" , "jiang.biao2@zte.com.cn" , "jslaby@suse.cz" , "yuehaibing@huawei.com" , "rppt@linux.ibm.com" , "ge.changwei@h3c.com" , "keescook@chromium.org" , "jannh@google.com" , "ashish.samant@oracle.com" , "npiggin@gmail.com" , "jiangyiwen@huawei.com" , Andy Shevchenko , "lchen@suse.com" , "malat@debian.org" , Morton Andrew Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace relaswap with built-in one, because of relaswap does a simple byte to byte swap. Signed-off-by: Andrey Abramov --- arch/powerpc/kernel/module_32.c | 17 +---------------- arch/powerpc/kernel/module_64.c | 17 +---------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c index 88d83771f462..c311e8575d10 100644 --- a/arch/powerpc/kernel/module_32.c +++ b/arch/powerpc/kernel/module_32.c @@ -79,21 +79,6 @@ static int relacmp(const void *_x, const void *_y) return 0; } -static void relaswap(void *_x, void *_y, int size) -{ - uint32_t *x, *y, tmp; - int i; - - y = (uint32_t *)_x; - x = (uint32_t *)_y; - - for (i = 0; i < sizeof(Elf32_Rela) / sizeof(uint32_t); i++) { - tmp = x[i]; - x[i] = y[i]; - y[i] = tmp; - } -} - /* Get the potential trampolines size required of the init and non-init sections */ static unsigned long get_plt_size(const Elf32_Ehdr *hdr, @@ -130,7 +115,7 @@ static unsigned long get_plt_size(const Elf32_Ehdr *hdr, */ sort((void *)hdr + sechdrs[i].sh_offset, sechdrs[i].sh_size / sizeof(Elf32_Rela), - sizeof(Elf32_Rela), relacmp, relaswap); + sizeof(Elf32_Rela), relacmp, NULL); ret += count_relocs((void *)hdr + sechdrs[i].sh_offset, diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index 8661eea78503..0c833d7f36f1 100644 --- a/arch/powerpc/kernel/module_64.c +++ b/arch/powerpc/kernel/module_64.c @@ -231,21 +231,6 @@ static int relacmp(const void *_x, const void *_y) return 0; } -static void relaswap(void *_x, void *_y, int size) -{ - uint64_t *x, *y, tmp; - int i; - - y = (uint64_t *)_x; - x = (uint64_t *)_y; - - for (i = 0; i < sizeof(Elf64_Rela) / sizeof(uint64_t); i++) { - tmp = x[i]; - x[i] = y[i]; - y[i] = tmp; - } -} - /* Get size of potential trampolines required. */ static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, const Elf64_Shdr *sechdrs) @@ -269,7 +254,7 @@ static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, */ sort((void *)sechdrs[i].sh_addr, sechdrs[i].sh_size / sizeof(Elf64_Rela), - sizeof(Elf64_Rela), relacmp, relaswap); + sizeof(Elf64_Rela), relacmp, NULL); relocs += count_relocs((void *)sechdrs[i].sh_addr, sechdrs[i].sh_size From patchwork Sat Mar 30 16:42:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1070955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UHXyJK82"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="eW/IcYg6"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44WktD1vs7z9sRf for ; Sun, 31 Mar 2019 03:42:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZfVBxrlCbsNAWa3SwZloKiBfHGDcXZEd2HTz3CnR8ZE=; b=UHXyJK82TT56W0 Qvw2QxdGaeb0K0cEtAWs76s8H+db+oPeWaygLAFvWb30m4xoa82XzVbBOvtC0T3/lAuRQzor7X/fr oANx7LknFuRXL30KTyILl0vqt3BCsALKsbiwC9j+L/IwuM9nYkyrLSV1c9VlZaWvR+51s6iq1wLx8 BDZTwqdF6nIR+qKUiBGZEyhi1HWq65dgcGdOxguXM4o0h+0fFPXJf9R9beGy/z06CJgFXcTDP3pPp //mTk0c7EgVLk1dhNYYWk2dpED8NZ1TQ8miEsm5DJ1Pj1QtEzw7OQIEUCswReotBsp3FGJaK2vZup uwMpxIZTieewTeRUzzLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH45-00048M-Tb; Sat, 30 Mar 2019 16:42:41 +0000 Received: from forward500p.mail.yandex.net ([77.88.28.110]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH3v-0003yG-5h; Sat, 30 Mar 2019 16:42:33 +0000 Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward500p.mail.yandex.net (Yandex) with ESMTP id A95F4940261; Sat, 30 Mar 2019 19:42:24 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9Vf1ajHZpZ-gHlu9bVR; Sat, 30 Mar 2019 19:42:23 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1553964143; bh=LM7LeHa743lvi4DRsEXm/wIP8IcZHVpJpFo+a5ZMhVw=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=eW/IcYg6/RpPaSzkLffrx92XO5yXFOEGS0RtoLfHfe9pAEGODdkr0DHEOeJI6RBng A45I2EP0IRBDDn7yaImdAlKNyoosHxa4zRYjaoh0XFTqB0qhq/KLjgxmBxIttBmoox JDNt0+Zv9+UW6b714qhDMfy1rLiJkUFwzaiItOAM= Authentication-Results: mxback20j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt3-c7e5d17fe013.qloud-c.yandex.net with HTTP; Sat, 30 Mar 2019 19:42:17 +0300 From: Andrey Abramov To: "vgupta@synopsys.com" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "mark@fasheh.com" , "jlbec@evilplan.org" , "richard@nod.at" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "gregkh@linuxfoundation.org" , "naveen.n.rao@linux.vnet.ibm.com" , "jpoimboe@redhat.com" , Dave Chinner , "darrick.wong@oracle.com" , "ard.biesheuvel@linaro.org" , George Spelvin , "linux-snps-arc@lists.infradead.org" , Linux Kernel Mailing List , "linuxppc-dev@lists.ozlabs.org" , "ocfs2-devel@oss.oracle.com" , "linux-mtd@lists.infradead.org" , "sfr@canb.auug.org.au" In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> Subject: [PATCH 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 30 Mar 2019 19:42:17 +0300 Message-Id: <3079511553964137@myt3-c7e5d17fe013.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_094232_182175_95FDEB56 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [77.88.28.110 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mhocko@suse.com" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "amir73il@gmail.com" , Rasmus Villemoes , "kamalesh@linux.vnet.ibm.com" , "piaojun@huawei.com" , "yamada.masahiro@socionext.com" , "jiang.biao2@zte.com.cn" , "jslaby@suse.cz" , "yuehaibing@huawei.com" , "rppt@linux.ibm.com" , "ge.changwei@h3c.com" , "keescook@chromium.org" , "jannh@google.com" , "ashish.samant@oracle.com" , "npiggin@gmail.com" , "jiangyiwen@huawei.com" , Andy Shevchenko , "lchen@suse.com" , "malat@debian.org" , Morton Andrew Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace dx_leaf_sort_swap, swap_refcount_rec and swap_xe functions with built-in one, because they do only a simple byte to byte swap. Signed-off-by: Andrey Abramov --- fs/ocfs2/dir.c | 13 +------------ fs/ocfs2/refcounttree.c | 13 +++---------- fs/ocfs2/xattr.c | 15 +++------------ 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index c121abbdfc7d..4b86b181df0a 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -3529,16 +3529,6 @@ static int dx_leaf_sort_cmp(const void *a, const void *b) return 0; } -static void dx_leaf_sort_swap(void *a, void *b, int size) -{ - struct ocfs2_dx_entry *entry1 = a; - struct ocfs2_dx_entry *entry2 = b; - - BUG_ON(size != sizeof(*entry1)); - - swap(*entry1, *entry2); -} - static int ocfs2_dx_leaf_same_major(struct ocfs2_dx_leaf *dx_leaf) { struct ocfs2_dx_entry_list *dl_list = &dx_leaf->dl_list; @@ -3799,8 +3789,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, * This block is changing anyway, so we can sort it in place. */ sort(dx_leaf->dl_list.de_entries, num_used, - sizeof(struct ocfs2_dx_entry), dx_leaf_sort_cmp, - dx_leaf_sort_swap); + sizeof(struct ocfs2_dx_entry), dx_leaf_sort_cmp, NULL); ocfs2_journal_dirty(handle, dx_leaf_bh); diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 1dc9a08e8bdc..7bbc94d23a0c 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -1400,13 +1400,6 @@ static int cmp_refcount_rec_by_cpos(const void *a, const void *b) return 0; } -static void swap_refcount_rec(void *a, void *b, int size) -{ - struct ocfs2_refcount_rec *l = a, *r = b; - - swap(*l, *r); -} - /* * The refcount cpos are ordered by their 64bit cpos, * But we will use the low 32 bit to be the e_cpos in the b-tree. @@ -1482,7 +1475,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh, */ sort(&rl->rl_recs, le16_to_cpu(rl->rl_used), sizeof(struct ocfs2_refcount_rec), - cmp_refcount_rec_by_low_cpos, swap_refcount_rec); + cmp_refcount_rec_by_low_cpos, NULL); ret = ocfs2_find_refcount_split_pos(rl, &cpos, &split_index); if (ret) { @@ -1507,11 +1500,11 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh, sort(&rl->rl_recs, le16_to_cpu(rl->rl_used), sizeof(struct ocfs2_refcount_rec), - cmp_refcount_rec_by_cpos, swap_refcount_rec); + cmp_refcount_rec_by_cpos, NULL); sort(&new_rl->rl_recs, le16_to_cpu(new_rl->rl_used), sizeof(struct ocfs2_refcount_rec), - cmp_refcount_rec_by_cpos, swap_refcount_rec); + cmp_refcount_rec_by_cpos, NULL); *split_cpos = cpos; return 0; diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 3a24ce3deb01..b3e6f42baf78 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -4175,15 +4175,6 @@ static int cmp_xe(const void *a, const void *b) return 0; } -static void swap_xe(void *a, void *b, int size) -{ - struct ocfs2_xattr_entry *l = a, *r = b, tmp; - - tmp = *l; - memcpy(l, r, sizeof(struct ocfs2_xattr_entry)); - memcpy(r, &tmp, sizeof(struct ocfs2_xattr_entry)); -} - /* * When the ocfs2_xattr_block is filled up, new bucket will be created * and all the xattr entries will be moved to the new bucket. @@ -4249,7 +4240,7 @@ static void ocfs2_cp_xattr_block_to_bucket(struct inode *inode, trace_ocfs2_cp_xattr_block_to_bucket_end(offset, size, off_change); sort(target + offset, count, sizeof(struct ocfs2_xattr_entry), - cmp_xe, swap_xe); + cmp_xe, NULL); } /* @@ -4444,7 +4435,7 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode, */ sort(entries, le16_to_cpu(xh->xh_count), sizeof(struct ocfs2_xattr_entry), - cmp_xe_offset, swap_xe); + cmp_xe_offset, NULL); /* Move all name/values to the end of the bucket. */ xe = xh->xh_entries; @@ -4486,7 +4477,7 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode, /* sort the entries by their name_hash. */ sort(entries, le16_to_cpu(xh->xh_count), sizeof(struct ocfs2_xattr_entry), - cmp_xe, swap_xe); + cmp_xe, NULL); buf = bucket_buf; for (i = 0; i < bucket->bu_blocks; i++, buf += blocksize) From patchwork Sat Mar 30 16:43:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1070957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lBPGy1u2"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="QTkIh7Rx"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Wkv252C5z9sRf for ; Sun, 31 Mar 2019 03:43:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bU1soHsGma27EtMDFz3oNFR8QSqO0ZZXr5ES6ASm9Io=; b=lBPGy1u2Rxa6qh ss/41WVoBTyLyVjqim1zvufAhhCZ4RA+PMGtiSIXzWZp63BRl58jvj7g0qJO5RJIlnFDY6G++0Ezb 1SplIfOGaAkPf63MfgvbPThGOJGX6l9ip4CnfviOsaQ1rPnsYxl2NAftNokgeIRT9tPm66fKN90L5 zSTmR2omBPZ79okpmK3wgp+umD7H0wAQeoUzg56258hmN2s0VNPJ2CX9M8I2c2xabZIsBFHPtnzaD 4Uh9VK5CUL7uUQKYPljQtM5E1mjKpFe88YRsVi9M/OGXjs3NH86cj1fq5RUpQiUZWj2J8ThNrpfYg 5jQ3wXl8E9gMwtYICoJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH4m-0004NX-BR; Sat, 30 Mar 2019 16:43:24 +0000 Received: from forward500j.mail.yandex.net ([5.45.198.250]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH4d-0004EZ-FG; Sat, 30 Mar 2019 16:43:17 +0000 Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward500j.mail.yandex.net (Yandex) with ESMTP id DD3F311C1158; Sat, 30 Mar 2019 19:43:08 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LJUEnkYk4E-h1u0KTbQ; Sat, 30 Mar 2019 19:43:07 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1553964187; bh=OUonaHqNIuKuUvrOfReQxgIYdywNfRwJw0ekJZnpMB8=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=QTkIh7RxhBsvpIf8O9AskAid7JET1vywlk3mWjJZ+vvwnNW2lcsBj20bonUUwHwJb oxG/xWjFYIB4W//uLG9oQZbZQhZl6SM7CKb4uotorQlzAqMl1ik23ffFVW1XI+HxEQ QcR+IpKMGPfzhq5RsGNRYcx5WIQLKMf9S7uPhPms= Authentication-Results: mxback10o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt5-f1576e7b5bad.qloud-c.yandex.net with HTTP; Sat, 30 Mar 2019 19:43:01 +0300 From: Andrey Abramov To: "vgupta@synopsys.com" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "mark@fasheh.com" , "jlbec@evilplan.org" , "richard@nod.at" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "gregkh@linuxfoundation.org" , "naveen.n.rao@linux.vnet.ibm.com" , "jpoimboe@redhat.com" , Dave Chinner , "darrick.wong@oracle.com" , "ard.biesheuvel@linaro.org" , George Spelvin , "linux-snps-arc@lists.infradead.org" , Linux Kernel Mailing List , "linuxppc-dev@lists.ozlabs.org" , "ocfs2-devel@oss.oracle.com" , "linux-mtd@lists.infradead.org" , "sfr@canb.auug.org.au" In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> Subject: [PATCH 4/5] ubifs: find.c: replace swap function with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 30 Mar 2019 19:43:01 +0300 Message-Id: <16620851553964181@myt5-f1576e7b5bad.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_094315_876249_D64B28AC X-CRM114-Status: UNSURE ( 6.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [5.45.198.250 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mhocko@suse.com" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "amir73il@gmail.com" , Rasmus Villemoes , "kamalesh@linux.vnet.ibm.com" , "piaojun@huawei.com" , "yamada.masahiro@socionext.com" , "jiang.biao2@zte.com.cn" , "jslaby@suse.cz" , "yuehaibing@huawei.com" , "rppt@linux.ibm.com" , "ge.changwei@h3c.com" , "keescook@chromium.org" , "jannh@google.com" , "ashish.samant@oracle.com" , "npiggin@gmail.com" , "jiangyiwen@huawei.com" , Andy Shevchenko , "lchen@suse.com" , "malat@debian.org" , Morton Andrew Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace swap_dirty_idx function with built-in one, because swap_dirty_idx does only a simple byte to byte swap. Signed-off-by: Andrey Abramov --- fs/ubifs/find.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index f9646835b026..5deaae7fcead 100644 --- a/fs/ubifs/find.c +++ b/fs/ubifs/find.c @@ -747,12 +747,6 @@ static int cmp_dirty_idx(const struct ubifs_lprops **a, return lpa->dirty + lpa->free - lpb->dirty - lpb->free; } -static void swap_dirty_idx(struct ubifs_lprops **a, struct ubifs_lprops **b, - int size) -{ - swap(*a, *b); -} - /** * ubifs_save_dirty_idx_lnums - save an array of the most dirty index LEB nos. * @c: the UBIFS file-system description object @@ -772,8 +766,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c) sizeof(void *) * c->dirty_idx.cnt); /* Sort it so that the dirtiest is now at the end */ sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *), - (int (*)(const void *, const void *))cmp_dirty_idx, - (void (*)(void *, void *, int))swap_dirty_idx); + (int (*)(const void *, const void *))cmp_dirty_idx, NULL); dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt); if (c->dirty_idx.cnt) dbg_find("dirtiest index LEB is %d with dirty %d and free %d", From patchwork Sat Mar 30 16:43:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1070958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IWRkiXaq"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="DnApBmxI"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Wkvy4XRtz9sRf for ; Sun, 31 Mar 2019 03:44:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/DtJZGqMsI5ixpXWabpClGM0WRrQCZu0Wfde0+zkvv8=; b=IWRkiXaqPYCbnR Yk8T9RPkNN+mnkzzV47ebwvCWtdNUMAFWMk5N2Is978x+uUuv/xH5L+N0bUOSb8GogehNjJ/PIJg5 hvc/WUmi9IcvIHBWMNcyi5Dt9u1N/uUXLUB0I2bntacneGKOKmj1hCyNRl8Y0dNyQzeaKRBuJF7CU cysu+D5V9EfuVDxqkU+UzaJRCUUg6jQBHjOwPELcKl5y51K7aTRihK98R1e0FV+LhfSJWe1LrU5xh tJwm8OxzspSrGv7GPK2aMvxdvDokLvk2V6sjRhl4LYWr+4U2DG+ov0OCMVYZvANZXTDMtACiOL0QL fPgWd3ZauspYDoZDgkQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH5X-0004ev-O1; Sat, 30 Mar 2019 16:44:11 +0000 Received: from forward501j.mail.yandex.net ([5.45.198.251]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAH5O-0004VJ-FA; Sat, 30 Mar 2019 16:44:04 +0000 Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward501j.mail.yandex.net (Yandex) with ESMTP id 02BEF33800D6; Sat, 30 Mar 2019 19:44:01 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jkS9SZAv9F-hrEetawC; Sat, 30 Mar 2019 19:44:00 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1553964240; bh=ekrJJPkvvc2IIUgqhYsDD1G/Ckjf+XccsQQiJwR67Z8=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=DnApBmxIFOz4WPtDyKFku2DHBCTBllcg3nquqyW5gX9yoWPHjzirhQIFjjO90Mwe/ Xp52jhwwjF+brDPqgA6bBwXXaI1dnNEU72Y6thZh46Owy41mFJ0yJNLA4+O4PWCLaH XIiOPJDaBosaoEXc5tZXNo3wn0HzUyrg/I46T+Qo= Authentication-Results: mxback18j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt4-c0b480c282c8.qloud-c.yandex.net with HTTP; Sat, 30 Mar 2019 19:43:53 +0300 From: Andrey Abramov To: "vgupta@synopsys.com" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "x86@kernel.org" , "mark@fasheh.com" , "jlbec@evilplan.org" , "richard@nod.at" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "gregkh@linuxfoundation.org" , "naveen.n.rao@linux.vnet.ibm.com" , "jpoimboe@redhat.com" , Dave Chinner , "darrick.wong@oracle.com" , "ard.biesheuvel@linaro.org" , George Spelvin , "linux-snps-arc@lists.infradead.org" , Linux Kernel Mailing List , "linuxppc-dev@lists.ozlabs.org" , "ocfs2-devel@oss.oracle.com" , "linux-mtd@lists.infradead.org" , "sfr@canb.auug.org.au" In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> Subject: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 30 Mar 2019 19:43:53 +0300 Message-Id: <20467491553964233@myt4-c0b480c282c8.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_094402_867003_84841BA5 X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [5.45.198.251 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mhocko@suse.com" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "amir73il@gmail.com" , Rasmus Villemoes , "kamalesh@linux.vnet.ibm.com" , "piaojun@huawei.com" , "yamada.masahiro@socionext.com" , "jiang.biao2@zte.com.cn" , "jslaby@suse.cz" , "yuehaibing@huawei.com" , "rppt@linux.ibm.com" , "ge.changwei@h3c.com" , "keescook@chromium.org" , "jannh@google.com" , "ashish.samant@oracle.com" , "npiggin@gmail.com" , "jiangyiwen@huawei.com" , Andy Shevchenko , "lchen@suse.com" , "malat@debian.org" , Morton Andrew Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace int type with size_t type of the size argument in the swap function, also affect all its dependencies. Signed-off-by: Andrey Abramov --- arch/x86/kernel/unwind_orc.c | 2 +- include/linux/sort.h | 2 +- kernel/jump_label.c | 2 +- lib/extable.c | 2 +- lib/sort.c | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index 89be1be1790c..1078c287198c 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -176,7 +176,7 @@ static struct orc_entry *orc_find(unsigned long ip) return orc_ftrace_find(ip); } -static void orc_sort_swap(void *_a, void *_b, int size) +static void orc_sort_swap(void *_a, void *_b, size_t size) { struct orc_entry *orc_a, *orc_b; struct orc_entry orc_tmp; diff --git a/include/linux/sort.h b/include/linux/sort.h index 2b99a5dd073d..aea39d552ff7 100644 --- a/include/linux/sort.h +++ b/include/linux/sort.h @@ -6,6 +6,6 @@ void sort(void *base, size_t num, size_t size, int (*cmp)(const void *, const void *), - void (*swap)(void *, void *, int)); + void (*swap)(void *, void *, size_t)); #endif diff --git a/kernel/jump_label.c b/kernel/jump_label.c index bad96b476eb6..340b788571fb 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -45,7 +45,7 @@ static int jump_label_cmp(const void *a, const void *b) return 0; } -static void jump_label_swap(void *a, void *b, int size) +static void jump_label_swap(void *a, void *b, size_t size) { long delta = (unsigned long)a - (unsigned long)b; struct jump_entry *jea = a; diff --git a/lib/extable.c b/lib/extable.c index f54996fdd0b8..db2888342cd7 100644 --- a/lib/extable.c +++ b/lib/extable.c @@ -28,7 +28,7 @@ static inline unsigned long ex_to_insn(const struct exception_table_entry *x) #ifndef ARCH_HAS_RELATIVE_EXTABLE #define swap_ex NULL #else -static void swap_ex(void *a, void *b, int size) +static void swap_ex(void *a, void *b, size_t size) { struct exception_table_entry *x = a, *y = b, tmp; int delta = b - a; diff --git a/lib/sort.c b/lib/sort.c index 50855ea8c262..60fbbc29104a 100644 --- a/lib/sort.c +++ b/lib/sort.c @@ -114,7 +114,7 @@ static void swap_bytes(void *a, void *b, size_t n) } while (n); } -typedef void (*swap_func_t)(void *a, void *b, int size); +typedef void (*swap_func_t)(void *a, void *b, size_t size); /* * The values are arbitrary as long as they can't be confused with @@ -138,7 +138,7 @@ static void do_swap(void *a, void *b, size_t size, swap_func_t swap_func) else if (swap_func == SWAP_BYTES) swap_bytes(a, b, size); else - swap_func(a, b, (int)size); + swap_func(a, b, size); } /** @@ -187,7 +187,7 @@ static size_t parent(size_t i, unsigned int lsbit, size_t size) */ void sort(void *base, size_t num, size_t size, int (*cmp_func)(const void *, const void *), - void (*swap_func)(void *, void *, int size)) + void (*swap_func)(void *, void *, size_t size)) { /* pre-scale counters for performance */ size_t n = num * size, a = (num/2) * size;