mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	shaun@xresource.ca, sachin.kamat@linaro.org,
	linux-kernel@vger.kernel.org, dulshani.gunawardhana89@gmail.com,
	ying.xue@windriver.com, davem@davemloft.net
Subject: Re: [PATCH 7/7] staging: cxt1e1: remove unneeded a value
Date: Wed, 5 Mar 2014 11:13:21 +0100	[thread overview]
Message-ID: <20140305101320.GH1883@distanz.ch> (raw)
In-Reply-To: <4401309.KAOCJ1Tfb2@daeseok-laptop.cloud.net>

On 2014-03-05 at 02:24:22 +0100, Daeseok Youn <daeseok.youn@gmail.com> wrote:
> 
> It doesn't need to assign name array address to np pointer.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/cxt1e1/linux.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
> index 5bb42ae..cae8c66 100644
> --- a/drivers/staging/cxt1e1/linux.c
> +++ b/drivers/staging/cxt1e1/linux.c
> @@ -205,15 +205,14 @@ 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);

This isn't necessary since s{,n}printf() adds a terminating '\0'.

> -	sprintf(np, "%s%d", pi->up->devname, pi->portnum); /* IE pmcc4-01) */
> +	sprintf(name, "%s%d", pi->up->devname, pi->portnum); /* IE pmcc4-01) */

Better use snprintf() here, even if the comment above claims the name
never to be no longer than 10 characters.

Cheers
Tobias

  reply	other threads:[~2014-03-05 10:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05  1:24 Daeseok Youn
2014-03-05 10:13 ` Tobias Klauser [this message]
2014-03-06  7:19   ` DaeSeok Youn
2014-03-06  7:33     ` Tobias Klauser
2014-03-06  7:47       ` DaeSeok Youn
  -- strict thread matches above, loose matches on Subject: below --
2014-03-04  2:14 Daeseok Youn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140305101320.GH1883@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=daeseok.youn@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=dulshani.gunawardhana89@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    --cc=shaun@xresource.ca \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome