public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 7/7] staging: cxt1e1: remove unneeded a value
@ 2014-03-06  8:12 Daeseok Youn
  2014-03-06 19:58 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Daeseok Youn @ 2014-03-06  8:12 UTC (permalink / raw)
  To: gregkh
  Cc: sachin.kamat, shaun, dulshani.gunawardhana89, davem, ying.xue,
	dan.carpenter, tklauser, devel, linux-kernel


It doesn't need to assign name array address to np pointer.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
v2: replace sprintf() with snprintf() and remove memset() call
because snprintf() adds a terminating '\0'

 drivers/staging/cxt1e1/linux.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 5bb42ae..9ac48ee 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -205,15 +205,13 @@ status_t
 c4_wq_port_init(mpi_t *pi)
 {
 
-	char        name[16], *np;  /* NOTE: name of the queue limited by system
+	char        name[16];  /* NOTE: name of the queue limited by system
 				     * to 10 characters */
-
 	if (pi->wq_port)
 		return 0;                   /* already initialized */
 
-	np = name;
-	memset(name, 0, 16);
-	sprintf(np, "%s%d", pi->up->devname, pi->portnum); /* IE pmcc4-01) */
+	/* IE pmcc4-01 */
+	snprintf(name, sizeof(name), "%s%d", pi->up->devname, pi->portnum);
 
 #ifdef RLD_RESTART_DEBUG
 	pr_info(">> %s: creating workqueue <%s> for Port %d.\n",
-- 
1.7.4.4



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

* Re: [PATCH v2 7/7] staging: cxt1e1: remove unneeded a value
  2014-03-06  8:12 [PATCH v2 7/7] staging: cxt1e1: remove unneeded a value Daeseok Youn
@ 2014-03-06 19:58 ` Greg KH
  2014-03-06 23:21   ` DaeSeok Youn
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2014-03-06 19:58 UTC (permalink / raw)
  To: Daeseok Youn
  Cc: devel, shaun, sachin.kamat, linux-kernel, dulshani.gunawardhana89,
	ying.xue, davem, dan.carpenter

On Thu, Mar 06, 2014 at 05:12:48PM +0900, Daeseok Youn wrote:
> 
> It doesn't need to assign name array address to np pointer.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> v2: replace sprintf() with snprintf() and remove memset() call
> because snprintf() adds a terminating '\0'

Your Subject: does not make sense, please fix it up and resend.

thanks,

greg k-h

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

* Re: [PATCH v2 7/7] staging: cxt1e1: remove unneeded a value
  2014-03-06 19:58 ` Greg KH
@ 2014-03-06 23:21   ` DaeSeok Youn
  0 siblings, 0 replies; 3+ messages in thread
From: DaeSeok Youn @ 2014-03-06 23:21 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Shaun Laing, sachin.kamat, linux-kernel,
	Dulshani Gunawardhana, ying.xue, David Miller, Dan Carpenter

Ok.
I will fix it and send again.

Thanks.
Daeseok Youn

2014-03-07 4:58 GMT+09:00 Greg KH <gregkh@linuxfoundation.org>:
> On Thu, Mar 06, 2014 at 05:12:48PM +0900, Daeseok Youn wrote:
>>
>> It doesn't need to assign name array address to np pointer.
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>> v2: replace sprintf() with snprintf() and remove memset() call
>> because snprintf() adds a terminating '\0'
>
> Your Subject: does not make sense, please fix it up and resend.
>
> thanks,
>
> greg k-h

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

end of thread, other threads:[~2014-03-06 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06  8:12 [PATCH v2 7/7] staging: cxt1e1: remove unneeded a value Daeseok Youn
2014-03-06 19:58 ` Greg KH
2014-03-06 23:21   ` DaeSeok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox