Search Linux Wireless

Re: [PATCH] wl1251: fix sparse-generated warnings

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

 



On Thu, Jul 22, 2010 at 3:45 AM, Kalle Valo <kalle.valo@xxxxxx> 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);

-- 
Bob Copeland %% www.bobcopeland.com
--
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 Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux