Skip to content

Commit

Permalink
[e1000] Fix dubious syntax in e1000 I/O wrapper macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brown committed Oct 11, 2008
1 parent 2e81223 commit 0b5c39d
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/drivers/net/e1000/e1000_osdep.h
Expand Up @@ -74,60 +74,60 @@ typedef enum {
#define DEBUGOUT3 DEBUGOUT1
#define DEBUGOUT7 DEBUGOUT1

#define E1000_WRITE_REG(a, reg, value) ( \
#define E1000_WRITE_REG(a, reg, value) \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))))
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))

#define E1000_READ_REG(a, reg) ( \
#define E1000_READ_REG(a, reg) \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))

#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2))))
((offset) << 2)))

#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
#define E1000_READ_REG_ARRAY(a, reg, offset) \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2)))
((offset) << 2))

#define E1000_READ_REG_ARRAY_DWORD E1000_READ_REG_ARRAY
#define E1000_WRITE_REG_ARRAY_DWORD E1000_WRITE_REG_ARRAY

#define E1000_WRITE_REG_ARRAY_WORD(a, reg, offset, value) ( \
#define E1000_WRITE_REG_ARRAY_WORD(a, reg, offset, value) \
writew((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 1))))
((offset) << 1)))

#define E1000_READ_REG_ARRAY_WORD(a, reg, offset) ( \
#define E1000_READ_REG_ARRAY_WORD(a, reg, offset) \
readw((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 1)))
((offset) << 1))

#define E1000_WRITE_REG_ARRAY_BYTE(a, reg, offset, value) ( \
#define E1000_WRITE_REG_ARRAY_BYTE(a, reg, offset, value) \
writeb((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
(offset))))
(offset)))

#define E1000_READ_REG_ARRAY_BYTE(a, reg, offset) ( \
#define E1000_READ_REG_ARRAY_BYTE(a, reg, offset) \
readb((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
(offset)))
(offset))

#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS)

#define E1000_WRITE_ICH_FLASH_REG(a, reg, value) ( \
writel((value), ((a)->flash_address + reg)))
#define E1000_WRITE_ICH_FLASH_REG(a, reg, value) \
writel((value), ((a)->flash_address + reg))

#define E1000_READ_ICH_FLASH_REG(a, reg) ( \
readl((a)->flash_address + reg))
#define E1000_READ_ICH_FLASH_REG(a, reg) \
readl((a)->flash_address + reg)

#define E1000_WRITE_ICH_FLASH_REG16(a, reg, value) ( \
writew((value), ((a)->flash_address + reg)))
#define E1000_WRITE_ICH_FLASH_REG16(a, reg, value) \
writew((value), ((a)->flash_address + reg))

#define E1000_READ_ICH_FLASH_REG16(a, reg) ( \
readw((a)->flash_address + reg))
#define E1000_READ_ICH_FLASH_REG16(a, reg) \
readw((a)->flash_address + reg)

#define msleep(n) mdelay(n)

Expand Down

0 comments on commit 0b5c39d

Please sign in to comment.