From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754079AbcEZOF4 (ORCPT ); Thu, 26 May 2016 10:05:56 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753969AbcEZOFz (ORCPT ); Thu, 26 May 2016 10:05:55 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Thu, 26 May 2016 10:05:54 EDT Subject: Re: [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc To: Salah Triki , dedekind1@gmail.com, adrian.hunter@intel.com References: <1464213858-4032-1-git-send-email-salah.triki@acm.org> Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org From: Richard Weinberger Message-ID: <5747012E.2070803@nod.at> Date: Thu, 26 May 2016 15:59:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1464213858-4032-1-git-send-email-salah.triki@acm.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > --- > 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