Skip to contentSkip to conversation

staging: cxt1e1: remove unneeded a value

PATCH In review Daeseok Youn 2 participants 3 messages Mar 6, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 7/7 staging: cxt1e1: remove unneeded a value

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

---
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(-)
drivers/staging/cxt1e1/linux.c +3 -5
index 5bb42ae..9ac48ee 100644
@@ -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",
Signature · 1 line
1.7.4.4
maintainer
#1 lore raw
Quoted 7 lines · Daeseok Youn

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

---
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

#2 lore raw

Ok.
I will fix it and send again.

Thanks.
Daeseok Youn

2014-03-07 4:58 GMT+09:00 Greg KH <[email protected]>:

Quoted 14 lines · Daeseok Youn
Quoted 7 lines

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

---
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