mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Sangjung Woo <sangjung.woo@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging:iio: fix wrong usage of dev_set_name()
Date: Thu, 03 Oct 2013 18:13:12 +0200	[thread overview]
Message-ID: <524D9798.70902@metafoo.de> (raw)
In-Reply-To: <1380812241-11589-1-git-send-email-sangjung.woo@samsung.com>

On 10/03/2013 04:57 PM, Sangjung Woo wrote:
> The second parameter of dev_set_name() is format string. In order to
> avoid any potential accidents such as segmentation fault, basic format
> parameter "%s" should be used in this case.

Since "iio_evgen" is a constant string there is really no need for this.

> 
> Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
> ---
>  drivers/staging/iio/iio_dummy_evgen.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/iio_dummy_evgen.c b/drivers/staging/iio/iio_dummy_evgen.c
> index 132d278..2c06d16 100644
> --- a/drivers/staging/iio/iio_dummy_evgen.c
> +++ b/drivers/staging/iio/iio_dummy_evgen.c
> @@ -205,7 +205,7 @@ static __init int iio_dummy_evgen_init(void)
>  	if (ret < 0)
>  		return ret;
>  	device_initialize(&iio_evgen_dev);
> -	dev_set_name(&iio_evgen_dev, "iio_evgen");
> +	dev_set_name(&iio_evgen_dev, "%s", "iio_evgen");
>  	return device_add(&iio_evgen_dev);
>  }
>  module_init(iio_dummy_evgen_init);
> 


      reply	other threads:[~2013-10-03 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03 14:57 Sangjung Woo
2013-10-03 16:13 ` Lars-Peter Clausen [this message]

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=524D9798.70902@metafoo.de \
    --to=lars@metafoo.de \
    --cc=akpm@linux-foundation.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sangjung.woo@samsung.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

all inboxes | Powered by JetHome®