Search Linux Wireless

Re: [PATCH 2/2] tkip: remove inlines duplicating byteorder macros

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

 



On Fri, 2008-03-07 at 19:17 -0800, Harvey Harrison wrote:
> Also remove Hi16/Lo16 and open code them in the one place they
> are used.

>  	int i, j;
> +	__le16 *ptr = (__le16 *)ta; /* address is held in LE byteorder */
> +
> +	p1k[0] = tsc_IV32 & 0xffff;
> +	p1k[1] = tsc_IV32 >> 16;
> +	p1k[2] = __le16_to_cpup(ptr++);
> +	p1k[3] = __le16_to_cpup(ptr++);
> +	p1k[4] = __le16_to_cpup(ptr);
>  
> -	p1k[0] = Lo16(tsc_IV32);
> -	p1k[1] = Hi16(tsc_IV32);
> -	p1k[2] = Mk16(ta[1], ta[0]);
> -	p1k[3] = Mk16(ta[3], ta[2]);
> -	p1k[4] = Mk16(ta[5], ta[4]);

NACK! Now the code assumes natural alignment of the u16s which is, as
far as I can tell, completely bogus. Please review
Documentation/unaligned-memory-access.txt.

Also, again, please don't use the underscored versions of functions.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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