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: 1071320 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44X19b3nhbz9sN6 for ; Sun, 31 Mar 2019 14:26:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; 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 lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44X19b2dbVzDqSY for ; Sun, 31 Mar 2019 14:26:59 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=yandex.ru (client-ip=2a02:6b8:0:801:2::110; helo=forward500j.mail.yandex.net; envelope-from=st5pub@yandex.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="QTkIh7Rx"; dkim-atps=neutral X-Greylist: delayed 314 seconds by postgrey-1.36 at bilbo; Sun, 31 Mar 2019 03:43:18 AEDT Received: from forward500j.mail.yandex.net (forward500j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44Wktt0w66zDqDq for ; Sun, 31 Mar 2019 03:43:17 +1100 (AEDT) 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-Mailman-Approved-At: Sun, 31 Mar 2019 14:25:39 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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",