Search Linux Wireless

Re: [rt2x00-users] [PATCH] rt2x00: increase led's name buffer length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxx>
> ---
>  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@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux