linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>,
	<linux-wireless@vger.kernel.org>, <ath6kl-devel@qualcomm.com>
Subject: Re: [PATCH 3/3] ath6kl: Remove few deadcode in main.c
Date: Tue, 3 Jan 2012 15:05:34 +0530	[thread overview]
Message-ID: <20120103093532.GA17369@chvasanth-lnx> (raw)
In-Reply-To: <1325578370.3905.3.camel@jlt3.sipsolutions.net>

On Tue, Jan 03, 2012 at 09:12:50AM +0100, Johannes Berg wrote:
> On Tue, 2012-01-03 at 11:10 +0530, Vasanthakumar Thiagarajan wrote:
> 
> > > > @@ -62,8 +62,7 @@ static void ath6kl_add_new_sta(struct ath6kl *ar, u8 *mac, u16 aid, u8 *wpaie,
> > > >  
> > > >  	sta = &ar->sta_list[free_slot];
> > > >  	memcpy(sta->mac, mac, ETH_ALEN);
> > > > -	if (ielen <= ATH6KL_MAX_IE)
> > > > -		memcpy(sta->wpa_ie, wpaie, ielen);
> > > > +	memcpy(sta->wpa_ie, wpaie, ielen);
> > 
> > > 
> > > And then someone changes the u8 ielen to something else and accidentally
> > > adds a bug. I would prefer to have an explicit check for the ielen to
> > > make it obvious what's the maximum length.
> > > 
> > > I don't really like using u8 for ielen either. IMHO size_t or similar
> > > would be better.
> > 
> > The length of any IE is 1 byte, u8 is the appropriate one.
> 
> No -- this can contain multiple IEs.

Right, it can, but as of now this is any one these ies, wpa, wapi, wpa/wpa2.
Ok, i don't see any disadvantage in converting this u8 to size_t,
i'll send the next version.

Vasanth

  reply	other threads:[~2012-01-03  9:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 10:35 [PATCH 1/3] ath6kl: Remove few unnecessary spin_locks around set_bit() Vasanthakumar Thiagarajan
2011-12-29 10:35 ` [PATCH 2/3] ath6kl: Add a module parameter to enable uart debug Vasanthakumar Thiagarajan
2011-12-29 10:35 ` [PATCH 3/3] ath6kl: Remove few deadcode in main.c Vasanthakumar Thiagarajan
2012-01-02 16:33   ` Kalle Valo
2012-01-03  5:40     ` Vasanthakumar Thiagarajan
2012-01-03  8:12       ` Johannes Berg
2012-01-03  9:35         ` Vasanthakumar Thiagarajan [this message]
2012-01-02 16:35 ` [PATCH 1/3] ath6kl: Remove few unnecessary spin_locks around set_bit() Kalle Valo

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=20120103093532.GA17369@chvasanth-lnx \
    --to=vthiagar@qca.qualcomm.com \
    --cc=ath6kl-devel@qualcomm.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.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 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).