From patchwork Mon Aug 6 02:49:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Song X-Patchwork-Id: 953657 X-Patchwork-Delegate: richard@nod.at 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-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ebTkYjv5"; 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 41kMbt0Rbxz9s3x for ; Mon, 6 Aug 2018 12:51:21 +1000 (AEST) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=ctOrjjtHrOthCvH6bMaSZizawHt5vYq9VC40msEeW6A=; b=ebT kYjv5fVTM3RlGSs2qP6PEaos/Vz4BkWzebESUpHIs/KMxa1uDA982Qb+n0ODa4QeEzE2t559MJCPX vVeIK7az0nxuJ+63VkOBDcAvo2SaDTyxVAQM1aMO26Qbn5xZOmgsuVDdEa/rZ5Hi9DCU1nEhp73GU B+v51lilVN5+vApudLbvmymgOUVKPvQxN2ZjibpZwRPozhWeTvuND/FVd9b5MvrMpkREvAdIJS12w qFOXoxJuYbkYn/Ri2S5NDA/Ov+DzZHcdGcEDiHEyW6hqkd79ill2nczasF9+n42pEyzMlILbwefVj yxcHi4Ae8ftDTpE30udOTBBCSHrOSZQ==; 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 1fmVc0-0003kH-7T; Mon, 06 Aug 2018 02:51:12 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmVbw-0003iM-S7 for linux-mtd@lists.infradead.org; Mon, 06 Aug 2018 02:51:10 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 592B9C1FB846F6E53185; Mon, 6 Aug 2018 10:50:48 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id w762oZGB066303; Mon, 6 Aug 2018 10:50:35 +0800 (GMT-8) (envelope-from liu.song11@zte.com.cn) Received: from localhost.localdomain ([10.75.10.200]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018080610503711-3252291 ; Mon, 6 Aug 2018 10:50:37 +0800 From: Liu Song To: richard@nod.at, dedekind1@gmail.com, adrian.hunter@intel.com Subject: [PATCH] Simplify redundant code Date: Mon, 6 Aug 2018 10:49:06 +0800 Message-Id: <1533523746-13197-1-git-send-email-liu.song11@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-08-06 10:50:37, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-08-06 10:50:36, Serialize complete at 2018-08-06 10:50:36 X-MAIL: mse01.zte.com.cn w762oZGB066303 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180805_195109_077829_47C1E515 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [63.217.80.70 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiang.biao2@zte.com.cn, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, liu.song11@zte.com.cn MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org cbuf's size can be simply assigned. Signed-off-by: Liu Song Reviewed-by: Jiang Biao --- fs/ubifs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index c5466c7..1a8e2032 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1245,8 +1245,7 @@ static int mount_ubifs(struct ubifs_info *c) if (err) goto out_free; - sz = ALIGN(c->max_idx_node_sz, c->min_io_size); - sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size); + sz = ALIGN(c->max_idx_node_sz, c->min_io_size) * 2; c->cbuf = kmalloc(sz, GFP_NOFS); if (!c->cbuf) { err = -ENOMEM;