lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
Date
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 <ndumbre@visteon.com>
>
> 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



\
 
 \ /
  Last update: 2015-05-20 10:21    [W:0.104 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site