ubifs: Simplify redundant code
authorLiu Song <liu.song11@zte.com.cn>
Mon, 6 Aug 2018 02:49:06 +0000 (10:49 +0800)
committerRichard Weinberger <richard@nod.at>
Mon, 8 Jul 2019 17:43:38 +0000 (19:43 +0200)
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>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/super.c

index 6cfc494..af68373 100644 (file)
@@ -1296,8 +1296,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;