linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: Replace kzalloc and memcpy by kmemdup
@ 2015-05-20  7:04 Dumbre, Nitesh Dilip (N.)
  2015-05-20  7:54 ` Drokin, Oleg
  2015-05-31  2:35 ` gregkh
  0 siblings, 2 replies; 5+ messages in thread
From: Dumbre, Nitesh Dilip (N.) @ 2015-05-20  7:04 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, gregkh, Julia.Lawall, joe, gdonald,
	akpm, rickard_strandqvist, uja.ornl, john.hammond,
	HPDD-discuss@lists.01.org, devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
  2015-05-20  7:04 [PATCH] staging: Replace kzalloc and memcpy by kmemdup Dumbre, Nitesh Dilip (N.)
@ 2015-05-20  7:54 ` Drokin, Oleg
  2015-05-31  2:35 ` gregkh
  1 sibling, 0 replies; 5+ messages in thread
From: Drokin, Oleg @ 2015-05-20  7:54 UTC (permalink / raw)
  To: Dumbre, Nitesh Dilip (N.)
  Cc: Dilger, Andreas, gregkh, Julia.Lawall, joe, gdonald, akpm,
	rickard_strandqvist, uja.ornl, Hammond, John,
	HPDD-discuss@lists.01.org, devel, linux-kernel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
  2015-05-20  7:04 [PATCH] staging: Replace kzalloc and memcpy by kmemdup Dumbre, Nitesh Dilip (N.)
  2015-05-20  7:54 ` Drokin, Oleg
@ 2015-05-31  2:35 ` gregkh
  2015-05-31 13:13   ` Joe Perches
  1 sibling, 1 reply; 5+ messages in thread
From: gregkh @ 2015-05-31  2:35 UTC (permalink / raw)
  To: Dumbre, Nitesh Dilip (N.)
  Cc: oleg.drokin, andreas.dilger, Julia.Lawall, joe, gdonald, akpm,
	rickard_strandqvist, uja.ornl, john.hammond,
	HPDD-discuss@lists.01.org, devel, linux-kernel

On Wed, May 20, 2015 at 07:04:27AM +0000, 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>

Name doesn't match the From: line, please fix your broken email client.

WHat is up with this company's email, there is a bunch of patches from
different people, all of them broken like this.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
  2015-05-31  2:35 ` gregkh
@ 2015-05-31 13:13   ` Joe Perches
  2015-05-31 20:56     ` gregkh
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2015-05-31 13:13 UTC (permalink / raw)
  To: gregkh
  Cc: Dumbre, Nitesh Dilip (N.),
	oleg.drokin, andreas.dilger, Julia.Lawall, gdonald, akpm,
	rickard_strandqvist, uja.ornl, john.hammond,
	HPDD-discuss@lists.01.org, devel, linux-kernel

On Sun, 2015-05-31 at 11:35 +0900, gregkh@linuxfoundation.org wrote:
> On Wed, May 20, 2015 at 07:04:27AM +0000, 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>
> 
> Name doesn't match the From: line, please fix your broken email client.
> 
> WHat is up with this company's email, there is a bunch of patches from
> different people, all of them broken like this.

Greg you are being a bit silly here.

The names match, but the company's email naming
policy is not "first last" but "last, first".

People generally sign their names "first last".

Nothing is broken but your desire for exact name
matching.

If this was an actual "From:" line in the body of
the email, you'd be more likely correct that the
names don't match, but this is not that case.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
  2015-05-31 13:13   ` Joe Perches
@ 2015-05-31 20:56     ` gregkh
  0 siblings, 0 replies; 5+ messages in thread
From: gregkh @ 2015-05-31 20:56 UTC (permalink / raw)
  To: Joe Perches
  Cc: devel, HPDD-discuss@lists.01.org, andreas.dilger, gdonald,
	uja.ornl, rickard_strandqvist, linux-kernel, oleg.drokin,
	Julia.Lawall, akpm, john.hammond, Dumbre, Nitesh Dilip (N.)

On Sun, May 31, 2015 at 06:13:00AM -0700, Joe Perches wrote:
> On Sun, 2015-05-31 at 11:35 +0900, gregkh@linuxfoundation.org wrote:
> > On Wed, May 20, 2015 at 07:04:27AM +0000, 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>
> > 
> > Name doesn't match the From: line, please fix your broken email client.
> > 
> > WHat is up with this company's email, there is a bunch of patches from
> > different people, all of them broken like this.
> 
> Greg you are being a bit silly here.
> 
> The names match, but the company's email naming
> policy is not "first last" but "last, first".
> 
> People generally sign their names "first last".
> 
> Nothing is broken but your desire for exact name
> matching.

There's also an odd "(H)." in the From line as well.

And yes, I do desire that as I know all about the tools we have that try
to check these things (numbers of developers, etc.) and some of them
don't like mismatched names.

Also, it's good for people to learn about "From:" in the body of the
email, that's what it is there for :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-31 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  7:04 [PATCH] staging: Replace kzalloc and memcpy by kmemdup Dumbre, Nitesh Dilip (N.)
2015-05-20  7:54 ` Drokin, Oleg
2015-05-31  2:35 ` gregkh
2015-05-31 13:13   ` Joe Perches
2015-05-31 20:56     ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).