Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2635243ybb; Sat, 30 Mar 2019 09:45:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSFKF6fWBktD/ZidsvvZekRHW5ZDBSLbrtyV1xBNe9C8cdSuQPoH7/wqCijTgxreAJv2EF X-Received: by 2002:a17:902:2e83:: with SMTP id r3mr37793516plb.153.1553964333367; Sat, 30 Mar 2019 09:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553964333; cv=none; d=google.com; s=arc-20160816; b=uT1f8bti/OgTS5D6Hwd0w+cvRnAxCS35dOrwWDKrz5Fk+3+nAxPUxY2W0AqAacDAUG YZBLiahb2mvXrk4UY643Y6b1iXqUThSr9tP2prdcOVhEPXC0u3e5vb5XIvZPQJMowTJA LcMSxMRUPBLb4Pvug1K2iKStvoAarmJEHgK7794M5yB+Wf2nrHm8jUfYJFgzrLUHZNp7 e4YUyMA1HzyW7c0BzVblC10isu1KfWFv8HCM2SwiObTVcstu+37O3DR5EjP2aMXAM4gn /2hpH5aGkOP1EUUBLRZ9FLybqTxPaunReUwt6xmcqMicwe/AeTPBqQvoGtv5OBGmPgyW PGMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :mime-version:subject:references:in-reply-to:cc:to:from :dkim-signature; bh=OUonaHqNIuKuUvrOfReQxgIYdywNfRwJw0ekJZnpMB8=; b=hAtOviWECx7D2cQ/7sWtQCIkjM+RYHZcjX6tGb4vzYFYKw9iQl+DIBnrNkeLBv5nfq 5fNpLi9399GtADc65cM5wI5Vl7/ciJSHNo0UtUphE5o1NI55uiY1D1y7e9Q2X/ApxOms bllQjrmb1PeGPLtqwhAyjvyK+VlZXBdPUx43KDmp/AUujqomDC4UIv2E+i4yjDTAyWys JZGQ9IUgTosunkd5TvwtwPtIUwOk5PG6NJYrChUR8tW2QpQHVGYiBJBmWrUNzBnT5jaW LImQ8GhZILZpiwFzVYT7QH4bM6+L/DyoMnt2tSHsy337D1lIpOuT1YrMZZQB2rV+50GO 9MMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=QTkIh7Rx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si368574pga.498.2019.03.30.09.45.18; Sat, 30 Mar 2019 09:45:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=QTkIh7Rx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730721AbfC3QnN (ORCPT + 99 others); Sat, 30 Mar 2019 12:43:13 -0400 Received: from forward500j.mail.yandex.net ([5.45.198.250]:37524 "EHLO forward500j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730154AbfC3QnM (ORCPT ); Sat, 30 Mar 2019 12:43:12 -0400 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" Cc: "rppt@linux.ibm.com" , Morton Andrew , "mhocko@suse.com" , "malat@debian.org" , "npiggin@gmail.com" , "yamada.masahiro@socionext.com" , "jannh@google.com" , "jslaby@suse.cz" , "ge.changwei@h3c.com" , "jiangyiwen@huawei.com" , "piaojun@huawei.com" , "amir73il@gmail.com" , "ashish.samant@oracle.com" , "yuehaibing@huawei.com" , "lchen@suse.com" , "jiang.biao2@zte.com.cn" , "gustavo@embeddedor.com" , "peterz@infradead.org" , "keescook@chromium.org" , Rasmus Villemoes , Andy Shevchenko , "kamalesh@linux.vnet.ibm.com" 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> Content-Transfer-Encoding: 7bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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", -- 2.21.0