On Wed, 16 May 2007 20:35:05 -0700 Randy Dunlap <randy.dunlap@xxxxxxxxxx> wrote: > > 5. This function: > > +static inline u8 iwl4965_get_dma_hi_address(dma_addr_t addr) > +{ > +#ifdef _X86_64_TYPES_H > + return addr >> 32; > +#else > +#ifdef _I386_TYPES_H > + return 0; > +#else > +#error "unsupported architecture" > +#endif > +#endif > +} > > a. For i386, dma_addr_t can still be 64 bits. See asm-i386/types.h: > > #ifdef CONFIG_HIGHMEM64G > typedef u64 dma_addr_t; > #else > typedef u32 dma_addr_t; > #endif > > b. Should use CONFIG_64BIT instead of checking _X64_64_TYPES_H or > _I386_TYPES_H. > > c. can just shift addr 32 bits right (in 2 shifts) in all cases: > > return (addr >> 16) >> 16; > I did this in sky2 driver: /* Return high part of DMA address (could be 32 or 64 bit) */ static inline u32 high32(dma_addr_t a) { return sizeof(a) > sizeof(u32) ? (a >> 16) >> 16 : 0; } -- Stephen Hemminger <shemminger@xxxxxxxxxxxxxxxxxxxx> - 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