From: Richard Weinberger <richard@nod.at>
To: Salah Triki <salah.triki@acm.org>,
dedekind1@gmail.com, adrian.hunter@intel.com
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc
Date: Thu, 26 May 2016 15:59:10 +0200 [thread overview]
Message-ID: <5747012E.2070803@nod.at> (raw)
In-Reply-To: <1464213858-4032-1-git-send-email-salah.triki@acm.org>
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@acm.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
prev parent reply other threads:[~2016-05-26 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 22:04 [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc Salah Triki
2016-05-26 13:59 ` Richard Weinberger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5747012E.2070803@nod.at \
--to=richard@nod.at \
--cc=adrian.hunter@intel.com \
--cc=dedekind1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=salah.triki@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox