[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5747012E.2070803@nod.at>
Date: Thu, 26 May 2016 15:59:10 +0200
From: Richard Weinberger <richard@....at>
To: Salah Triki <salah.triki@....org>, dedekind1@...il.com,
adrian.hunter@...el.com
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with
kmem_cache_zalloc
Am 26.05.2016 um 00:04 schrieb Salah Triki:
> Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.
>
> Signed-off-by: Salah Triki <salah.triki@....org>
> ---
> fs/ubifs/super.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 7034995..f509200 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -262,12 +262,10 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb)
> {
> struct ubifs_inode *ui;
>
> - ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS);
> + ui = kmem_cache_zalloc(ubifs_inode_slab, GFP_NOFS);
> if (!ui)
> return NULL;
>
> - memset((void *)ui + sizeof(struct inode), 0,
> - sizeof(struct ubifs_inode) - sizeof(struct inode));
Your patch fails to explain why it is needed.
Also note that the path slightly changes the semantics.
Thanks,
//richard
Powered by blists - more mailing lists