Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbbETHyU (ORCPT ); Wed, 20 May 2015 03:54:20 -0400 Received: from mga03.intel.com ([134.134.136.65]:8498 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbbETHyS convert rfc822-to-8bit (ORCPT ); Wed, 20 May 2015 03:54:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,463,1427785200"; d="scan'208";a="697627665" From: "Drokin, Oleg" To: "Dumbre, Nitesh Dilip (N.)" CC: "Dilger, Andreas" , "gregkh@linuxfoundation.org" , "Julia.Lawall@lip6.fr" , "joe@perches.com" , "gdonald@gmail.com" , "akpm@linux-foundation.org" , "rickard_strandqvist@spectrumdigital.se" , "uja.ornl@gmail.com" , "Hammond, John" , "HPDD-discuss@lists.01.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup Thread-Topic: [PATCH] staging: Replace kzalloc and memcpy by kmemdup Thread-Index: AQHQkss1pMv2vFXO2k24i0vENa2Jup2E9BgA Date: Wed, 20 May 2015 07:54:16 +0000 Message-ID: <8A20D2B6-19FC-490B-AADF-D2B376E9E4E7@intel.com> References: <20150520070418.GA28946@jci-VirtualBox> In-Reply-To: <20150520070418.GA28946@jci-VirtualBox> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.190.252] Content-Type: text/plain; charset="us-ascii" Content-ID: <92FB184C6092A245BD00ED0C3EC315AA@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1603 Lines: 39 Thanks! But rather than that, this whole function (lprocfs_exp_setup) needs to go, since it's not used by anything on the client. The removal is sitting in my queue of "stop using procfs in lustre" patches that I am going to submit real soon now and this patch would just create an unnecessary conflict. On May 20, 2015, at 3:04 AM, Dumbre, Nitesh Dilip (N.) wrote: > This patch was generated by coccicheck and replaces kzalloc followed > by memcpy with kmemdup > > Signed-off-by: Nitesh Dumbre > > diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c > index 57c6ddd..c988be4 100644 > --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c > +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c > @@ -1711,13 +1711,12 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid) > goto destroy_new; > } > /* not found - create */ > - buffer = kzalloc(LNET_NIDSTR_SIZE, GFP_NOFS); > + buffer = kmemdup(libcfs_nid2str(*nid), LNET_NIDSTR_SIZE, GFP_NOFS); > if (buffer == NULL) { > rc = -ENOMEM; > goto destroy_new; > } > > - memcpy(buffer, libcfs_nid2str(*nid), LNET_NIDSTR_SIZE); > new_stat->nid_proc = lprocfs_register(buffer, > obd->obd_proc_exports_entry, > NULL, NULL); > -- > 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/