tlan: Code cleanup: checkpatch.pl is relatively happy now.

- Remove CamelCase.
- Convert hexadecimals to lower case.
- Remove useless comments. Tlan driver contained a name of the function at
  the end of it in a comment. Remove those comments.
- Remove local typedefs. Use real types instead of typedefs in code.
- Resolve space issues and reindent.
- One warning remain, it's a case where printing a single line involves a
  number of printk()s.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sakari Ailus
2011-01-21 10:59:30 +00:00
committed by David S. Miller
parent c445477d74
commit c659c38b27
2 changed files with 1913 additions and 1874 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -20,8 +20,8 @@
********************************************************************/ ********************************************************************/
#include <asm/io.h> #include <linux/io.h>
#include <asm/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
@@ -41,7 +41,10 @@
#define TLAN_RECORD 1 #define TLAN_RECORD 1
#define TLAN_DBG(lvl, format, args...) \ #define TLAN_DBG(lvl, format, args...) \
do { if (debug&lvl) printk(KERN_DEBUG "TLAN: " format, ##args ); } while(0) do { \
if (debug&lvl) \
printk(KERN_DEBUG "TLAN: " format, ##args); \
} while (0)
#define TLAN_DEBUG_GNRL 0x0001 #define TLAN_DEBUG_GNRL 0x0001
#define TLAN_DEBUG_TX 0x0002 #define TLAN_DEBUG_TX 0x0002
@@ -50,7 +53,8 @@
#define TLAN_DEBUG_PROBE 0x0010 #define TLAN_DEBUG_PROBE 0x0010
#define TX_TIMEOUT (10*HZ) /* We need time for auto-neg */ #define TX_TIMEOUT (10*HZ) /* We need time for auto-neg */
#define MAX_TLAN_BOARDS 8 /* Max number of boards installed at a time */ #define MAX_TLAN_BOARDS 8 /* Max number of boards installed
at a time */
/***************************************************************** /*****************************************************************
@@ -70,13 +74,13 @@
#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 #define PCI_DEVICE_ID_OLICOM_OC2326 0x0014
#endif #endif
typedef struct tlan_adapter_entry { struct tlan_adapter_entry {
u16 vendorId; u16 vendor_id;
u16 deviceId; u16 device_id;
char *deviceLabel; char *device_label;
u32 flags; u32 flags;
u16 addrOfs; u16 addr_ofs;
} TLanAdapterEntry; };
#define TLAN_ADAPTER_NONE 0x00000000 #define TLAN_ADAPTER_NONE 0x00000000
#define TLAN_ADAPTER_UNMANAGED_PHY 0x00000001 #define TLAN_ADAPTER_UNMANAGED_PHY 0x00000001
@@ -129,18 +133,18 @@ typedef struct tlan_adapter_entry {
#define TLAN_CSTAT_DP_PR 0x0100 #define TLAN_CSTAT_DP_PR 0x0100
typedef struct tlan_buffer_ref_tag { struct tlan_buffer {
u32 count; u32 count;
u32 address; u32 address;
} TLanBufferRef; };
typedef struct tlan_list_tag { struct tlan_list {
u32 forward; u32 forward;
u16 cStat; u16 c_stat;
u16 frameSize; u16 frame_size;
TLanBufferRef buffer[TLAN_BUFFERS_PER_LIST]; struct tlan_buffer buffer[TLAN_BUFFERS_PER_LIST];
} TLanList; };
typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]; typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE];
@@ -164,49 +168,49 @@ typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE];
* *
****************************************************************/ ****************************************************************/
typedef struct tlan_private_tag { struct tlan_priv {
struct net_device *nextDevice; struct net_device *next_device;
struct pci_dev *pciDev; struct pci_dev *pci_dev;
struct net_device *dev; struct net_device *dev;
void *dmaStorage; void *dma_storage;
dma_addr_t dmaStorageDMA; dma_addr_t dma_storage_dma;
unsigned int dmaSize; unsigned int dma_size;
u8 *padBuffer; u8 *pad_buffer;
TLanList *rxList; struct tlan_list *rx_list;
dma_addr_t rxListDMA; dma_addr_t rx_list_dma;
u8 *rxBuffer; u8 *rx_buffer;
dma_addr_t rxBufferDMA; dma_addr_t rx_buffer_dma;
u32 rxHead; u32 rx_head;
u32 rxTail; u32 rx_tail;
u32 rxEocCount; u32 rx_eoc_count;
TLanList *txList; struct tlan_list *tx_list;
dma_addr_t txListDMA; dma_addr_t tx_list_dma;
u8 *txBuffer; u8 *tx_buffer;
dma_addr_t txBufferDMA; dma_addr_t tx_buffer_dma;
u32 txHead; u32 tx_head;
u32 txInProgress; u32 tx_in_progress;
u32 txTail; u32 tx_tail;
u32 txBusyCount; u32 tx_busy_count;
u32 phyOnline; u32 phy_online;
u32 timerSetAt; u32 timer_set_at;
u32 timerType; u32 timer_type;
struct timer_list timer; struct timer_list timer;
struct board *adapter; struct board *adapter;
u32 adapterRev; u32 adapter_rev;
u32 aui; u32 aui;
u32 debug; u32 debug;
u32 duplex; u32 duplex;
u32 phy[2]; u32 phy[2];
u32 phyNum; u32 phy_num;
u32 speed; u32 speed;
u8 tlanRev; u8 tlan_rev;
u8 tlanFullDuplex; u8 tlan_full_duplex;
spinlock_t lock; spinlock_t lock;
u8 link; u8 link;
u8 is_eisa; u8 is_eisa;
struct work_struct tlan_tqueue; struct work_struct tlan_tqueue;
u8 neg_be_verbose; u8 neg_be_verbose;
} TLanPrivateInfo; };
@@ -439,37 +443,37 @@ typedef struct tlan_private_tag {
/* Routines to access internal registers. */ /* Routines to access internal registers. */
static inline u8 TLan_DioRead8(u16 base_addr, u16 internal_addr) static inline u8 tlan_dio_read8(u16 base_addr, u16 internal_addr)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
return inb((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x3)); return inb((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x3));
} /* TLan_DioRead8 */ }
static inline u16 TLan_DioRead16(u16 base_addr, u16 internal_addr) static inline u16 tlan_dio_read16(u16 base_addr, u16 internal_addr)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
return inw((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x2)); return inw((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x2));
} /* TLan_DioRead16 */ }
static inline u32 TLan_DioRead32(u16 base_addr, u16 internal_addr) static inline u32 tlan_dio_read32(u16 base_addr, u16 internal_addr)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
return inl(base_addr + TLAN_DIO_DATA); return inl(base_addr + TLAN_DIO_DATA);
} /* TLan_DioRead32 */ }
static inline void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data) static inline void tlan_dio_write8(u16 base_addr, u16 internal_addr, u8 data)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
outb(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x3)); outb(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x3));
@@ -479,7 +483,7 @@ static inline void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
static inline void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data) static inline void tlan_dio_write16(u16 base_addr, u16 internal_addr, u16 data)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
outw(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x2)); outw(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x2));
@@ -489,16 +493,16 @@ static inline void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
static inline void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data) static inline void tlan_dio_write32(u16 base_addr, u16 internal_addr, u32 data)
{ {
outw(internal_addr, base_addr + TLAN_DIO_ADR); outw(internal_addr, base_addr + TLAN_DIO_ADR);
outl(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x2)); outl(data, base_addr + TLAN_DIO_DATA + (internal_addr & 0x2));
} }
#define TLan_ClearBit( bit, port ) outb_p(inb_p(port) & ~bit, port) #define tlan_clear_bit(bit, port) outb_p(inb_p(port) & ~bit, port)
#define TLan_GetBit( bit, port ) ((int) (inb_p(port) & bit)) #define tlan_get_bit(bit, port) ((int) (inb_p(port) & bit))
#define TLan_SetBit( bit, port ) outb_p(inb_p(port) | bit, port) #define tlan_set_bit(bit, port) outb_p(inb_p(port) | bit, port)
/* /*
* given 6 bytes, view them as 8 6-bit numbers and return the XOR of those * given 6 bytes, view them as 8 6-bit numbers and return the XOR of those
@@ -526,7 +530,7 @@ static inline void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
* DA(a,35), DA(a,41), DA(a,47)) << 5; * DA(a,35), DA(a,41), DA(a,47)) << 5;
* *
*/ */
static inline u32 TLan_HashFunc( const u8 *a ) static inline u32 tlan_hash_func(const u8 *a)
{ {
u8 hash; u8 hash;