linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Simplify redundant code
@ 2018-08-06  2:49 Liu Song
  0 siblings, 0 replies; only message in thread
From: Liu Song @ 2018-08-06  2:49 UTC (permalink / raw)
  To: richard, dedekind1, adrian.hunter
  Cc: linux-mtd, linux-kernel, liu.song11, jiang.biao2, zhong.weidong

cbuf's size can be simply assigned.

Signed-off-by: Liu Song <liu.song11@zte.com.cn>
Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
---
 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;
-- 
2.1.0.GIT


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-06  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06  2:49 [PATCH] Simplify redundant code Liu Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).