All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@iki.fi>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH v2 2/4] ath9k_hw: distinguish single-chip solutions on initial probe print
Date: Mon, 26 Oct 2009 22:31:44 +0200	[thread overview]
Message-ID: <87d449hp73.fsf@purkki.valot.fi> (raw)
In-Reply-To: <1256575447-4591-1-git-send-email-lrodriguez@atheros.com> (Luis R. Rodriguez's message of "Mon\, 26 Oct 2009 12\:44\:07 -0400")

"Luis R. Rodriguez" <lrodriguez@atheros.com> writes:

> Devices with external radios have revisions which we can count on.
> On single chip solutions these EEPROM values for these radio revision
> also exist but are not meaningful as the radios are embedded onto the
> same chip. Each single-chip device evolves together as one device.
>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
>
> Changes hw_name to 60 bytes.

Thanks, much better now.

Another minor comment, sorry that I didn't notice it earlier:

> +void ath9k_hw_name(struct ath_hw *ah, char *hw_name)
> +{
> +	/* chipsets >= AR9280 are single-chip */
> +	if (AR_SREV_9280_10_OR_LATER(ah)) {
> +		sprintf(hw_name,
> +			"Atheros single-chip AR%s Rev:%x",
> +			ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
> +			ah->hw_version.macRev);
> +	}
> +	else {
> +		sprintf(hw_name,
> +			"Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x: ",
> +			ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
> +			ah->hw_version.macRev,
> +			ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
> +					 AR_RADIO_SREV_MAJOR)),
> +			ah->hw_version.phyRev);
> +	}
> +}

I think you should provide the size of hw_name to this function and
use snprintf() to avoid writing out of bounds.

-- 
Kalle Valo

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kalle.valo@iki.fi>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	ath9k-devel@lists.ath9k.org
Subject: Re: [PATCH v2 2/4] ath9k_hw: distinguish single-chip solutions on initial probe print
Date: Mon, 26 Oct 2009 22:31:44 +0200	[thread overview]
Message-ID: <87d449hp73.fsf@purkki.valot.fi> (raw)
In-Reply-To: <1256575447-4591-1-git-send-email-lrodriguez@atheros.com> (Luis R. Rodriguez's message of "Mon\, 26 Oct 2009 12\:44\:07 -0400")

"Luis R. Rodriguez" <lrodriguez@atheros.com> writes:

> Devices with external radios have revisions which we can count on.
> On single chip solutions these EEPROM values for these radio revision
> also exist but are not meaningful as the radios are embedded onto the
> same chip. Each single-chip device evolves together as one device.
>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
>
> Changes hw_name to 60 bytes.

Thanks, much better now.

Another minor comment, sorry that I didn't notice it earlier:

> +void ath9k_hw_name(struct ath_hw *ah, char *hw_name)
> +{
> +	/* chipsets >= AR9280 are single-chip */
> +	if (AR_SREV_9280_10_OR_LATER(ah)) {
> +		sprintf(hw_name,
> +			"Atheros single-chip AR%s Rev:%x",
> +			ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
> +			ah->hw_version.macRev);
> +	}
> +	else {
> +		sprintf(hw_name,
> +			"Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x: ",
> +			ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
> +			ah->hw_version.macRev,
> +			ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
> +					 AR_RADIO_SREV_MAJOR)),
> +			ah->hw_version.phyRev);
> +	}
> +}

I think you should provide the size of hw_name to this function and
use snprintf() to avoid writing out of bounds.

-- 
Kalle Valo

  reply	other threads:[~2009-10-26 20:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 16:44 [ath9k-devel] [PATCH v2 2/4] ath9k_hw: distinguish single-chip solutions on initial probe print Luis R. Rodriguez
2009-10-26 16:44 ` Luis R. Rodriguez
2009-10-26 20:31 ` Kalle Valo [this message]
2009-10-26 20:31   ` Kalle Valo
2009-10-26 20:44   ` [ath9k-devel] " Luis R. Rodriguez
2009-10-26 20:44     ` Luis R. Rodriguez
2009-10-26 21:15     ` [ath9k-devel] " Kalle Valo
2009-10-26 21:15       ` Kalle Valo
2009-10-26 21:32       ` [ath9k-devel] " Luis R. Rodriguez
2009-10-26 21:32         ` Luis R. Rodriguez
2009-10-27 16:56         ` [ath9k-devel] " Luis R. Rodriguez
2009-10-27 16:56           ` Luis R. Rodriguez

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=87d449hp73.fsf@purkki.valot.fi \
    --to=kalle.valo@iki.fi \
    --cc=ath9k-devel@lists.ath9k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.