linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Jakub Kicinski <kubakici@wp.pl>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH] rt2x00: increase led's name buffer length
Date: Mon, 19 Mar 2012 12:03:34 +0100	[thread overview]
Message-ID: <20120319110332.GB6169@redhat.com> (raw)
In-Reply-To: <1332026212-5391-1-git-send-email-kubakici@wp.pl>

On Sun, Mar 18, 2012 at 12:16:52AM +0100, Jakub Kicinski wrote:
> With 9-letter driver names phy's number was truncated
> to two characters, which caused warnings when creating
> sysfs entries for leds on systems with multiple devices.
> 
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
> ---
>  drivers/net/wireless/rt2x00/rt2x00leds.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c
> index ca585e3..8679d78 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00leds.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00leds.c
> @@ -124,17 +124,15 @@ static int rt2x00leds_register_led(struct rt2x00_dev *rt2x00dev,
>  
>  void rt2x00leds_register(struct rt2x00_dev *rt2x00dev)
>  {
> -	char dev_name[16];
> -	char name[32];
> +	char name[36];
>  	int retval;
>  	unsigned long on_period;
>  	unsigned long off_period;
> -
> -	snprintf(dev_name, sizeof(dev_name), "%s-%s",
> -		 rt2x00dev->ops->name, wiphy_name(rt2x00dev->hw->wiphy));
> +	const char *phy_name = wiphy_name(rt2x00dev->hw->wiphy);
>  
>  	if (rt2x00dev->led_radio.flags & LED_INITIALIZED) {
> -		snprintf(name, sizeof(name), "%s::radio", dev_name);
> +		snprintf(name, sizeof(name), "%s-%s::radio",
> +			 rt2x00dev->ops->name, phy_name);
I guess simpler would be just increase dev_name length, but patch looks
correct to me anyway.

Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>

  reply	other threads:[~2012-03-19 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-17 23:16 [PATCH] rt2x00: increase led's name buffer length Jakub Kicinski
2012-03-19 11:03 ` Stanislaw Gruszka [this message]
2012-03-19 20:21 ` Gertjan van Wingerde

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=20120319110332.GB6169@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=kubakici@wp.pl \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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;
as well as URLs for NNTP newsgroup(s).