All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis R. Rodriguez <lrodriguez@atheros.com>
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 13:44:47 -0700	[thread overview]
Message-ID: <20091026204447.GA5713@tux> (raw)
In-Reply-To: <87d449hp73.fsf@purkki.valot.fi>

On Mon, Oct 26, 2009 at 01:31:44PM -0700, Kalle Valo wrote:
> "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.

I was going to do this but since I know the users of it and control
it seemed to not matter. I'll respin with this added, better to be careful.

Thanks for the review.

  Luis

WARNING: multiple messages have this Message-ID (diff)
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Kalle Valo <kalle.valo@iki.fi>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ath9k-devel@lists.ath9k.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 13:44:47 -0700	[thread overview]
Message-ID: <20091026204447.GA5713@tux> (raw)
In-Reply-To: <87d449hp73.fsf@purkki.valot.fi>

On Mon, Oct 26, 2009 at 01:31:44PM -0700, Kalle Valo wrote:
> "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.

I was going to do this but since I know the users of it and control
it seemed to not matter. I'll respin with this added, better to be careful.

Thanks for the review.

  Luis

  reply	other threads:[~2009-10-26 20:44 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 ` [ath9k-devel] " Kalle Valo
2009-10-26 20:31   ` Kalle Valo
2009-10-26 20:44   ` Luis R. Rodriguez [this message]
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=20091026204447.GA5713@tux \
    --to=lrodriguez@atheros.com \
    --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.