Search Linux Wireless

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

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

 



On Thu, 2010-07-22 at 09:45 +0200, ext Kalle Valo wrote:
> On 07/22/2010 08:34 AM, Luciano Coelho 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;
> >>  
> >> -		fc = *(u16 *)(skb->data + sizeof(*tx_hdr));
> >> -		tx_hdr->length += WL1251_TKIP_IV_SPACE;
> >> +		fc = *(__le16 *)(skb->data + sizeof(*tx_hdr));
> > 
> > Is this going to work? sizeof(*tx_hdr), and the operation, will be in
> > the cpu's endianess, right?
> 
> I think this is correct. We first calculate a pointer to a __le16 value
> and then dereference that value to a __le16 variable.

Yes, you're right, I got totally confused for some reason, as I already
pointed out on my other email.  I completely missed the fact that we
were dealing with pointers here.  It seems like my brain works as that
of a Java programmer before my morning dose of caffeine :P

-- 
Cheers,
Luca.

--
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