linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Bob Copeland <me@bobcopeland.com>
Cc: Kalle Valo <kalle.valo@iki.fi>,
	Luciano Coelho <luciano.coelho@nokia.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wl1251: fix sparse-generated warnings
Date: Thu, 22 Jul 2010 09:16:27 -0400	[thread overview]
Message-ID: <20100722131627.GA18742@tuxdriver.com> (raw)
In-Reply-To: <AANLkTimh-2cuWdJKgf2TUkCQmGXDC0-86xVhbA-kiPGR@mail.gmail.com>

On Thu, Jul 22, 2010 at 08:04:02AM -0400, Bob Copeland wrote:
> On Thu, Jul 22, 2010 at 3:45 AM, Kalle Valo <kalle.valo@iki.fi> wrote:
> >>> @@ -191,11 +191,13 @@ static int wl1251_tx_send_packet(struct wl1251 *wl, struct sk_buff *skb,
> >>>      if (control->control.hw_key &&
> >>>          control->control.hw_key->alg == ALG_TKIP) {
> >>>              int hdrlen;
> >>> -            u16 fc;
> >>> +            __le16 fc;
> >>> +            u16 length;
> >>>              u8 *pos;
> [...]
> >>> +            length = le16_to_cpu(tx_hdr->length) + WL1251_TKIP_IV_SPACE;
> >>> +            tx_hdr->length = cpu_to_le16(length);
> >>
> >> ...which is treated correctly here.
> >
> > This is different. Here we are adding something to a __le16 value, not
> > calculating with pointers.
> 
> Just throwing in my 2 cents, unless there's some other reason to add the
> length temporary, here you can just do:
> 
>     le16_add_cpu(&tx_hdr->length, WL1251_TKIP_IV_SPACE);

Ah, thanks!  I thought there was something like that, but I couldn't remember. :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2010-07-22 13:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21 16:31 [PATCH] wl1251: fix sparse-generated warnings John W. Linville
2010-07-22  6:34 ` Luciano Coelho
2010-07-22  7:38   ` Luciano Coelho
2010-07-22  7:45   ` Kalle Valo
2010-07-22  7:57     ` Luciano Coelho
2010-07-22 12:04     ` Bob Copeland
2010-07-22 13:16       ` John W. Linville [this message]
2010-07-22 13:21     ` John W. Linville
2010-07-23  8:14       ` Kalle Valo
2010-07-22  8:45 ` Kalle Valo
2010-07-22  8:52   ` Luciano Coelho
2010-07-22  9:21     ` 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=20100722131627.GA18742@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=kalle.valo@iki.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@nokia.com \
    --cc=me@bobcopeland.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).