From 993fb90c5b1727342362c43ed4e29c26682f54f7 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 5 Nov 2007 18:07:31 +0100 Subject: drivers/net/netxen/: cleanups This patch contains the following cleanups: - static functions in .c files shouldn't be marked inline - make needlessly global code static - #if 0 unused code Signed-off-by: Adrian Bunk Signed-off-by: Jeff Garzik --- drivers/net/netxen/netxen_nic_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/net/netxen/netxen_nic_main.c') diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 263b55e36c7a..8e7736987b94 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -89,8 +89,8 @@ MODULE_DEVICE_TABLE(pci, netxen_pci_tbl); struct workqueue_struct *netxen_workq; static void netxen_watchdog(unsigned long); -static inline void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, - uint32_t crb_producer) +static void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, + uint32_t crb_producer) { switch (adapter->portnum) { case 0: @@ -118,8 +118,8 @@ static inline void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter } } -static inline void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter, - u32 crb_consumer) +static void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter, + u32 crb_consumer) { switch (adapter->portnum) { case 0: @@ -148,7 +148,6 @@ static inline void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter } #define ADAPTER_LIST_SIZE 12 -int netxen_cards_found; static void netxen_nic_disable_int(struct netxen_adapter *adapter) { -- cgit v1.2.3 From 5bc51424b4d1c1121fb8861620f14262d828d1d9 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 19 Nov 2007 17:48:24 -0800 Subject: drivers/net/netxen: Add missing "space" Signed-off-by: Joe Perches Signed-off-by: Jeff Garzik --- drivers/net/netxen/netxen_nic_hw.c | 2 +- drivers/net/netxen/netxen_nic_init.c | 4 ++-- drivers/net/netxen/netxen_nic_main.c | 6 +++--- drivers/net/netxen/netxen_nic_niu.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/net/netxen/netxen_nic_main.c') diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index b2c78612beed..a87309c9689c 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -666,7 +666,7 @@ void netxen_nic_pci_change_crbwindow(struct netxen_adapter *adapter, u32 wndw) NETXEN_PCIX_PH_REG(PCIX_CRB_WINDOW_F3)); break; default: - printk(KERN_INFO "Changing the window for PCI function" + printk(KERN_INFO "Changing the window for PCI function " "%d\n", adapter->ahw.pci_func); offset = PCI_OFFSET_SECOND_RANGE(adapter, NETXEN_PCIX_PH_REG(PCIX_CRB_WINDOW)); diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 68c985f3e0b7..1647903a6cf0 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c @@ -1107,8 +1107,8 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, } if (buffer->lro_current_frags != buffer->lro_expected_frags) { if (buffer->lro_expected_frags != 0) { - printk("LRO: (refhandle:%x) recv frag." - "wait for last. flags: %x expected:%d" + printk("LRO: (refhandle:%x) recv frag. " + "wait for last. flags: %x expected:%d " "have:%d\n", index, netxen_get_sts_desc_lro_last_frag(desc), buffer->lro_expected_frags, diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 8e7736987b94..97006e16f6de 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -286,7 +286,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk(KERN_INFO "%s \n", netxen_nic_driver_string); if (pdev->class != 0x020000) { - printk(KERN_ERR"NetXen function %d, class %x will not" + printk(KERN_ERR"NetXen function %d, class %x will not " "be enabled.\n",pci_func_id, pdev->class); return -ENODEV; } @@ -510,7 +510,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) vmalloc(RCV_BUFFSIZE); if (rcv_desc->rx_buf_arr == NULL) { - printk(KERN_ERR "%s: Could not allocate" + printk(KERN_ERR "%s: Could not allocate " "rcv_desc->rx_buf_arr memory:%d\n", netxen_nic_driver_name, (int)RCV_BUFFSIZE); @@ -980,7 +980,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) } if (frag_count > MAX_BUFFERS_PER_CMD) { - printk("%s: %s netxen_nic_xmit_frame: frag_count (%d)" + printk("%s: %s netxen_nic_xmit_frame: frag_count (%d) " "too large, can handle only %d frags\n", netxen_nic_driver_name, netdev->name, frag_count, MAX_BUFFERS_PER_CMD); diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index e1086efd53c5..2815689bc9af 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c @@ -547,8 +547,8 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, port, enable); } else { - printk(KERN_ERR PFX "ERROR reading" - "PHY status. Illegal speed.\n"); + printk(KERN_ERR PFX "ERROR reading " + "PHY status. Invalid speed.\n"); result = -1; } } else { -- cgit v1.2.3 From 4790654c71b250018ecc234f6b9f1ed96a55572d Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 23 Nov 2007 21:23:36 -0500 Subject: [netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace) Signed-off-by: Jeff Garzik --- drivers/net/netxen/netxen_nic.h | 16 +++++++-------- drivers/net/netxen/netxen_nic_ethtool.c | 26 ++++++++++++------------ drivers/net/netxen/netxen_nic_hw.c | 12 +++++------ drivers/net/netxen/netxen_nic_hw.h | 10 +++++----- drivers/net/netxen/netxen_nic_init.c | 24 +++++++++++----------- drivers/net/netxen/netxen_nic_isr.c | 8 ++++---- drivers/net/netxen/netxen_nic_main.c | 20 +++++++++---------- drivers/net/netxen/netxen_nic_niu.c | 34 ++++++++++++++++---------------- drivers/net/netxen/netxen_nic_phan_reg.h | 8 ++++---- 9 files changed, 79 insertions(+), 79 deletions(-) (limited to 'drivers/net/netxen/netxen_nic_main.c') diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index b9d2191e03c9..724f75560ddb 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h @@ -113,8 +113,8 @@ #define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) extern struct workqueue_struct *netxen_workq; -/* - * normalize a 64MB crb address to 32MB PCI window +/* + * normalize a 64MB crb address to 32MB PCI window * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1 */ #define NETXEN_CRB_NORMAL(reg) \ @@ -736,11 +736,11 @@ struct netxen_skb_frag { (config_word) &= ~__tmask; \ (config_word) |= (((__tvalue) << (start)) & __tmask); \ } - + #define _netxen_clear_bits(config_word, start, bits) {\ unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \ (config_word) &= ~__tmask; \ -} +} /* Following defines are for the state of the buffers */ #define NETXEN_BUFFER_FREE 0 @@ -879,7 +879,7 @@ struct netxen_dummy_dma { struct netxen_adapter { struct netxen_hardware_context ahw; - + struct netxen_adapter *master; struct net_device *netdev; struct pci_dev *pdev; @@ -916,7 +916,7 @@ struct netxen_adapter { u32 temp; struct netxen_adapter_stats stats; - + u16 portno; u16 link_speed; u16 link_duplex; @@ -1050,9 +1050,9 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); int netxen_load_firmware(struct netxen_adapter *adapter); int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); -int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, +int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, u8 *bytes, size_t size); -int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, +int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, u8 *bytes, size_t size); int netxen_flash_unlock(struct netxen_adapter *adapter); int netxen_backup_crbinit(struct netxen_adapter *adapter); diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index cdec4f87e1ed..7a876f4b8db2 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c @@ -423,11 +423,11 @@ netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, if (eeprom->len == 0) return -EINVAL; - eeprom->magic = (adapter->pdev)->vendor | + eeprom->magic = (adapter->pdev)->vendor | ((adapter->pdev)->device << 16); offset = eeprom->offset; - ret = netxen_rom_fast_read_words(adapter, offset, bytes, + ret = netxen_rom_fast_read_words(adapter, offset, bytes, eeprom->len); if (ret < 0) return ret; @@ -453,16 +453,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, netxen_nic_driver_name); return ret; } - printk(KERN_INFO "%s: flash unlocked. \n", + printk(KERN_INFO "%s: flash unlocked. \n", netxen_nic_driver_name); last_schedule_time = jiffies; ret = netxen_flash_erase_secondary(adapter); if (ret != FLASH_SUCCESS) { - printk(KERN_ERR "%s: Flash erase failed.\n", + printk(KERN_ERR "%s: Flash erase failed.\n", netxen_nic_driver_name); return ret; } - printk(KERN_INFO "%s: secondary flash erased successfully.\n", + printk(KERN_INFO "%s: secondary flash erased successfully.\n", netxen_nic_driver_name); flash_start = 1; return 0; @@ -471,7 +471,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, if (offset == NETXEN_BOOTLD_START) { ret = netxen_flash_erase_primary(adapter); if (ret != FLASH_SUCCESS) { - printk(KERN_ERR "%s: Flash erase failed.\n", + printk(KERN_ERR "%s: Flash erase failed.\n", netxen_nic_driver_name); return ret; } @@ -483,16 +483,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, if (ret != FLASH_SUCCESS) return ret; - printk(KERN_INFO "%s: primary flash erased successfully\n", + printk(KERN_INFO "%s: primary flash erased successfully\n", netxen_nic_driver_name); ret = netxen_backup_crbinit(adapter); if (ret != FLASH_SUCCESS) { - printk(KERN_ERR "%s: CRBinit backup failed.\n", + printk(KERN_ERR "%s: CRBinit backup failed.\n", netxen_nic_driver_name); return ret; } - printk(KERN_INFO "%s: CRBinit backup done.\n", + printk(KERN_INFO "%s: CRBinit backup done.\n", netxen_nic_driver_name); ready_to_flash = 1; } @@ -570,7 +570,7 @@ netxen_nic_get_pauseparam(struct net_device *dev, else pause->tx_pause = !(netxen_xg_get_xg1_mask(val)); } else { - printk(KERN_ERR"%s: Unknown board type: %x\n", + printk(KERN_ERR"%s: Unknown board type: %x\n", netxen_nic_driver_name, adapter->ahw.board_type); } } @@ -589,7 +589,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, /* set flow control */ netxen_nic_read_w0(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), &val); - + if (pause->rx_pause) netxen_gb_rx_flowctl(val); else @@ -642,10 +642,10 @@ netxen_nic_set_pauseparam(struct net_device *dev, else netxen_xg_set_xg1_mask(val); } - netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); + netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); } else { printk(KERN_ERR "%s: Unknown board type: %x\n", - netxen_nic_driver_name, + netxen_nic_driver_name, adapter->ahw.board_type); } return 0; diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index a87309c9689c..a88c51f0879b 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -160,7 +160,7 @@ struct netxen_recv_crb recv_crb_registers[] = { }, /* Jumbo frames */ { - /* crb_rcv_producer_offset: */ + /* crb_rcv_producer_offset: */ NETXEN_NIC_REG(0x1f8), /* crb_rcv_consumer_offset: */ NETXEN_NIC_REG(0x1fc), @@ -209,7 +209,7 @@ struct netxen_recv_crb recv_crb_registers[] = { }, /* Jumbo frames */ { - /* crb_rcv_producer_offset: */ + /* crb_rcv_producer_offset: */ NETXEN_NIC_REG(0x23c), /* crb_rcv_consumer_offset: */ NETXEN_NIC_REG(0x240), @@ -888,7 +888,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value) netxen_nic_pci_change_crbwindow(adapter, 1); } -static int netxen_pci_set_window_warning_count = 0; +static int netxen_pci_set_window_warning_count; static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, unsigned long long addr) @@ -958,7 +958,7 @@ int netxen_nic_erase_pxe(struct netxen_adapter *adapter) { if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) { - printk(KERN_ERR "%s: erase pxe failed\n", + printk(KERN_ERR "%s: erase pxe failed\n", netxen_nic_driver_name); return -1; } @@ -1039,9 +1039,9 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) { new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; if (physical_port[adapter->portnum] == 0) - netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, + netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); - else + else netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, new_mtu); return 0; diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index 197e1fc7333d..a3ea1dd98c41 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h @@ -235,7 +235,7 @@ typedef enum { ((config_word) |= 1 << 0) #define netxen_xg_set_xg1_mask(config_word) \ ((config_word) |= 1 << 3) - + #define netxen_xg_get_xg0_mask(config_word) \ _netxen_crb_get_bit((config_word), 0) #define netxen_xg_get_xg1_mask(config_word) \ @@ -273,7 +273,7 @@ typedef enum { _netxen_crb_get_bit((config_word), 4) #define netxen_gb_get_gb3_mask(config_word) \ _netxen_crb_get_bit((config_word), 6) - + #define netxen_gb_unset_gb0_mask(config_word) \ ((config_word) &= ~(1 << 0)) #define netxen_gb_unset_gb1_mask(config_word) \ @@ -437,7 +437,7 @@ typedef enum { /* * NIU GB Drop CRC Register - * + * * Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on * Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on * Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on @@ -480,7 +480,7 @@ typedef enum { /* * MAC Control Register - * + * * Bit 0-1 : id_pool0 * Bit 2 : enable_xtnd0 * Bit 4-5 : id_pool1 @@ -515,7 +515,7 @@ typedef enum { ((config) |= (((val) & 0x0f) << 28)) /* Set promiscuous mode for a GbE interface */ -int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, +int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, netxen_niu_prom_mode_t mode); int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, netxen_niu_prom_mode_t mode); diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 1647903a6cf0..74685a1a0b71 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c @@ -449,7 +449,7 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr, } int -netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, +netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, u8 *bytes, size_t size) { int ret; @@ -490,7 +490,7 @@ int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) } #endif /* 0 */ -static int do_rom_fast_write_words(struct netxen_adapter *adapter, +static int do_rom_fast_write_words(struct netxen_adapter *adapter, int addr, u8 *bytes, size_t size) { int addridx = addr; @@ -505,7 +505,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, ret = do_rom_fast_write(adapter, addridx, data); if (ret < 0) return ret; - + while(1) { int data1; @@ -518,7 +518,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, if (timeout++ >= rom_write_timeout) { if (last_attempt++ < 4) { - ret = do_rom_fast_write(adapter, + ret = do_rom_fast_write(adapter, addridx, data); if (ret < 0) return ret; @@ -538,7 +538,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, return ret; } -int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, +int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, u8 *bytes, size_t size) { int ret = 0; @@ -562,7 +562,7 @@ static int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) return ret; netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_WDATA, data); - netxen_crb_writelit_adapter(adapter, + netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0x1); ret = netxen_wait_rom_done(adapter); @@ -592,7 +592,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL); if (!buffer) - return -ENOMEM; + return -ENOMEM; /* unlock sector 63 */ val = netxen_rom_rdsr(adapter); val = val & 0xe3; @@ -605,12 +605,12 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) goto out_kfree; /* copy sector 0 to sector 63 */ - ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START, + ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START, buffer, NETXEN_FLASH_SECTOR_SIZE); if (ret != FLASH_SUCCESS) goto out_kfree; - ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START, + ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START, buffer, NETXEN_FLASH_SECTOR_SIZE); if (ret != FLASH_SUCCESS) goto out_kfree; @@ -658,9 +658,9 @@ static void check_erased_flash(struct netxen_adapter *adapter, int addr) int count = 0, erased_errors = 0; int range; - range = (addr == NETXEN_USER_START) ? + range = (addr == NETXEN_USER_START) ? NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE; - + for (i = addr; i < range; i += 4) { netxen_rom_fast_read(adapter, i, &val); if (val != 0xffffffff) @@ -1495,7 +1495,7 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, count++; /* now there should be no failure */ pdesc = &rcv_desc->desc_head[producer]; skb_reserve(skb, 2); - /* + /* * This will be setup when we receive the * buffer after it has been filled * skb->dev = netdev; diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index 0a261de0a953..48a404aa66ce 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c @@ -48,7 +48,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) /* total packets received */ stats->rx_packets = adapter->stats.no_rcv; /* total packets transmitted */ - stats->tx_packets = adapter->stats.xmitedframes + + stats->tx_packets = adapter->stats.xmitedframes + adapter->stats.xmitfinished; /* total bytes received */ stats->rx_bytes = adapter->stats.rxbytes; @@ -84,7 +84,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) /* This should clear the interrupt source */ if (adapter->phy_read) - adapter->phy_read(adapter, + adapter->phy_read(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, &int_src); if (int_src == 0) { @@ -113,7 +113,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); if (adapter->phy_read - && adapter->phy_read(adapter, + && adapter->phy_read(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, &status) == 0) { if (netxen_get_phy_int_link_status_changed(int_src)) { @@ -127,7 +127,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) netxen_nic_driver_name, adapter->netdev->name); } - netxen_indicate_link_status(adapter, + netxen_indicate_link_status(adapter, netxen_get_phy_link (status)); } diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 97006e16f6de..97ba14b759b4 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -350,7 +350,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) first_page_group_start = 0; first_page_group_end = 0; } else { - err = -EIO; + err = -EIO; goto err_out_free_netdev; } @@ -410,7 +410,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->open = netxen_nic_open; netdev->stop = netxen_nic_close; netdev->hard_start_xmit = netxen_nic_xmit_frame; - netdev->get_stats = netxen_nic_get_stats; + netdev->get_stats = netxen_nic_get_stats; netdev->set_multicast_list = netxen_nic_set_multi; netdev->set_mac_address = netxen_nic_set_mac; netdev->change_mtu = netxen_nic_change_mtu; @@ -457,8 +457,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST; if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) || - (adapter->ahw.boardcfg.board_type == - NETXEN_BRDTYPE_P2_SB31_2G)) + (adapter->ahw.boardcfg.board_type == + NETXEN_BRDTYPE_P2_SB31_2G)) adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; else adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS; @@ -583,9 +583,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (adapter->portnum == 0) { err = netxen_initialize_adapter_offload(adapter); - if (err) + if (err) goto err_out_free_rx_buffer; - val = readl(NETXEN_CRB_NORMALIZE(adapter, + val = readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); if (val == 0x55555555) { /* This is the first boot after power up */ @@ -619,7 +619,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* * Tell the hardware our version number. */ - i = (_NETXEN_NIC_LINUX_MAJOR << 16) + i = (_NETXEN_NIC_LINUX_MAJOR << 16) | ((_NETXEN_NIC_LINUX_MINOR << 8)) | (_NETXEN_NIC_LINUX_SUBVERSION); writel(i, NETXEN_CRB_NORMALIZE(adapter, CRB_DRIVER_VERSION)); @@ -659,7 +659,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) break; case NETXEN_NIC_XGBE: - printk(KERN_INFO "%s: XGbE board initialized\n", + printk(KERN_INFO "%s: XGbE board initialized\n", netxen_nic_driver_name); break; } @@ -930,7 +930,7 @@ static int netxen_nic_close(struct net_device *netdev) buffrag++; if (buffrag->dma) { pci_unmap_page(adapter->pdev, buffrag->dma, - buffrag->length, + buffrag->length, PCI_DMA_TODEVICE); buffrag->dma = 0ULL; } @@ -1194,7 +1194,7 @@ static void netxen_tx_timeout(struct net_device *netdev) static void netxen_tx_timeout_task(struct work_struct *work) { - struct netxen_adapter *adapter = + struct netxen_adapter *adapter = container_of(work, struct netxen_adapter, tx_timeout_task); printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 2815689bc9af..1c852a76c80d 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c @@ -75,7 +75,7 @@ static int phy_unlock(struct netxen_adapter *adapter) return 0; } -/* +/* * netxen_niu_gbe_phy_read - read a register from the GbE PHY via * mii management interface. * @@ -88,7 +88,7 @@ static int phy_unlock(struct netxen_adapter *adapter) * -1 on error * */ -int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, +int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, __u32 * readval) { long timeout = 0; @@ -171,7 +171,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, return result; } -/* +/* * netxen_niu_gbe_phy_write - write a register to the GbE PHY via * mii management interface. * @@ -184,7 +184,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, * -1 on error * */ -int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, +int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, __u32 val) { long timeout = 0; @@ -275,7 +275,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter) netxen_set_phy_int_speed_changed(enable); if (0 != - netxen_niu_gbe_phy_write(adapter, + netxen_niu_gbe_phy_write(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE, enable)) result = -EIO; @@ -312,7 +312,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) { int result = 0; if (0 != - netxen_niu_gbe_phy_write(adapter, + netxen_niu_gbe_phy_write(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, -EIO)) result = -EIO; @@ -320,7 +320,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) return result; } -/* +/* * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC * */ @@ -344,9 +344,9 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); if (enable) { - /* - * Do NOT enable flow control until a suitable solution for - * shutting down pause frames is found. + /* + * Do NOT enable flow control until a suitable solution for + * shutting down pause frames is found. */ netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), @@ -359,7 +359,7 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n"); } -/* +/* * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC */ static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, @@ -382,9 +382,9 @@ static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); if (enable) { - /* - * Do NOT enable flow control until a suitable solution for - * shutting down pause frames is found. + /* + * Do NOT enable flow control until a suitable solution for + * shutting down pause frames is found. */ netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), @@ -467,7 +467,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) } #if 0 -/* +/* * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts * @param enable 0 means don't enable the port * 1 means enable (or re-enable) the port @@ -623,7 +623,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) return -2; - netxen_niu_macaddr_get(adapter, + netxen_niu_macaddr_get(adapter, (netxen_ethernet_macaddr_t *) mac_addr); if (memcmp(mac_addr, addr, 6) == 0) break; @@ -753,7 +753,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) } /* Set promiscuous mode for a GbE interface */ -int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, +int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, netxen_niu_prom_mode_t mode) { __u32 reg; diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h index a6c28de1dbc5..ffa3b7215ce8 100644 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ b/drivers/net/netxen/netxen_nic_phan_reg.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2003 - 2006 NetXen, Inc. * All rights reserved. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -16,10 +16,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. - * + * * The full GNU General Public License is included in this distribution * in the file called LICENSE. - * + * * Contact Information: * info@netxen.com * NetXen, @@ -30,7 +30,7 @@ #ifndef __NIC_PHAN_REG_H_ #define __NIC_PHAN_REG_H_ -/* +/* * CRB Registers or queue message done only at initialization time. */ #define NIC_CRB_BASE NETXEN_CAM_RAM(0x200) -- cgit v1.2.3 From 79ea13ce07c951bb4d95471e7300baa0f1be9e78 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 24 Jan 2008 02:06:46 -0800 Subject: NULL noise in drivers/net Signed-off-by: Al Viro Signed-off-by: Jeff Garzik Signed-off-by: David S. Miller --- drivers/net/3c515.c | 2 +- drivers/net/7990.c | 8 +++----- drivers/net/a2065.c | 10 ++++------ drivers/net/bnx2.c | 4 ++-- drivers/net/cassini.c | 2 +- drivers/net/eepro100.c | 2 +- drivers/net/hamradio/6pack.c | 2 +- drivers/net/hamradio/mkiss.c | 2 +- drivers/net/hp100.c | 2 +- drivers/net/mac89x0.c | 2 +- drivers/net/mace.c | 10 +++++----- drivers/net/netxen/netxen_nic_main.c | 6 +++--- drivers/net/skfp/hwmtm.c | 4 ++-- drivers/net/skfp/smt.c | 2 +- drivers/net/sungem.c | 2 +- drivers/net/sunhme.c | 2 +- drivers/net/tg3.c | 2 +- drivers/net/tokenring/smctr.c | 4 ++-- drivers/net/wan/lmc/lmc_main.c | 6 +++--- drivers/net/wan/lmc/lmc_media.c | 8 ++------ drivers/net/wan/pc300_drv.c | 8 ++++---- drivers/net/wan/pc300_tty.c | 12 ++++++------ drivers/net/wireless/airo.c | 2 +- drivers/net/xen-netfront.c | 2 +- 24 files changed, 49 insertions(+), 57 deletions(-) (limited to 'drivers/net/netxen/netxen_nic_main.c') diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 684bab781015..6ab84b661d70 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c @@ -1361,7 +1361,7 @@ static int boomerang_rx(struct net_device *dev) /* Check if the packet is long enough to just accept without copying to a properly sized skbuff. */ if (pkt_len < rx_copybreak - && (skb = dev_alloc_skb(pkt_len + 4)) != 0) { + && (skb = dev_alloc_skb(pkt_len + 4)) != NULL) { skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ /* 'skb_put()' points to the start of sk_buff data area. */ memcpy(skb_put(skb, pkt_len), diff --git a/drivers/net/7990.c b/drivers/net/7990.c index 224e0bff1ae0..750a46f4bc58 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c @@ -277,8 +277,6 @@ static int lance_rx (struct net_device *dev) volatile struct lance_init_block *ib = lp->init_block; volatile struct lance_rx_desc *rd; unsigned char bits; - int len = 0; /* XXX shut up gcc warnings */ - struct sk_buff *skb = 0; /* XXX shut up gcc warnings */ #ifdef TEST_HITS int i; #endif @@ -318,10 +316,10 @@ static int lance_rx (struct net_device *dev) if (bits & LE_R1_FRA) dev->stats.rx_frame_errors++; if (bits & LE_R1_EOP) dev->stats.rx_errors++; } else { - len = (rd->mblength & 0xfff) - 4; - skb = dev_alloc_skb (len+2); + int len = (rd->mblength & 0xfff) - 4; + struct sk_buff *skb = dev_alloc_skb (len+2); - if (skb == 0) { + if (!skb) { printk ("%s: Memory squeeze, deferring packet.\n", dev->name); dev->stats.rx_dropped++; diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 18f7f815f66e..6c5719ae8cca 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c @@ -269,8 +269,6 @@ static int lance_rx (struct net_device *dev) volatile struct lance_regs *ll = lp->ll; volatile struct lance_rx_desc *rd; unsigned char bits; - int len = 0; /* XXX shut up gcc warnings */ - struct sk_buff *skb = 0; /* XXX shut up gcc warnings */ #ifdef TEST_HITS int i; @@ -306,10 +304,10 @@ static int lance_rx (struct net_device *dev) if (bits & LE_R1_FRA) dev->stats.rx_frame_errors++; if (bits & LE_R1_EOP) dev->stats.rx_errors++; } else { - len = (rd->mblength & 0xfff) - 4; - skb = dev_alloc_skb (len+2); + int len = (rd->mblength & 0xfff) - 4; + struct sk_buff *skb = dev_alloc_skb (len+2); - if (skb == 0) { + if (!skb) { printk(KERN_WARNING "%s: Memory squeeze, " "deferring packet.\n", dev->name); dev->stats.rx_dropped++; @@ -477,7 +475,7 @@ static irqreturn_t lance_interrupt (int irq, void *dev_id) return IRQ_HANDLED; } -struct net_device *last_dev = 0; +struct net_device *last_dev; static int lance_open (struct net_device *dev) { diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 94d1857d2c5d..3bb69d538ef0 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -2757,7 +2757,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) } #ifdef BCM_VLAN - if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && (bp->vlgrp != 0)) { + if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && bp->vlgrp) { vlan_hwaccel_receive_skb(skb, bp->vlgrp, rx_hdr->l2_fhdr_vlan_tag); } @@ -5660,7 +5660,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; } - if (bp->vlgrp != 0 && vlan_tx_tag_present(skb)) { + if (bp->vlgrp && vlan_tx_tag_present(skb)) { vlan_tag_flags |= (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); } diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 2bacb5e4604d..14299f8063af 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c @@ -5085,7 +5085,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, /* give us access to cassini registers */ cp->regs = pci_iomap(pdev, 0, casreg_len); - if (cp->regs == 0UL) { + if (!cp->regs) { dev_err(&pdev->dev, "Cannot map device registers, aborting.\n"); goto err_out_free_res; } diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 1548a80f917d..3003e9276976 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -1788,7 +1788,7 @@ speedo_rx(struct net_device *dev) /* Check if the packet is long enough to just accept without copying to a properly sized skbuff. */ if (pkt_len < rx_copybreak - && (skb = dev_alloc_skb(pkt_len + 2)) != 0) { + && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ /* 'skb_put()' points to the start of sk_buff data area. */ pci_dma_sync_single_for_cpu(sp->pdev, sp->rx_ring_dma[entry], diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 580cb4ab2af1..0a9b75139e0f 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -701,7 +701,7 @@ static void sixpack_close(struct tty_struct *tty) sp = tty->disc_data; tty->disc_data = NULL; write_unlock(&disc_data_lock); - if (sp == 0) + if (!sp) return; /* diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 803a3bdea0af..cfcd15af501e 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -821,7 +821,7 @@ static void mkiss_close(struct tty_struct *tty) tty->disc_data = NULL; write_unlock(&disc_data_lock); - if (ax == 0) + if (!ax) return; /* diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 49421d1cd3a5..571dd80fb850 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c @@ -1153,7 +1153,7 @@ static void hp100_init_pdls(struct net_device *dev) printk("hp100: %s: init pdls\n", dev->name); #endif - if (0 == lp->page_vaddr_algn) + if (!lp->page_vaddr_algn) printk("hp100: %s: Warning: lp->page_vaddr_algn not initialised!\n", dev->name); else { /* pageptr shall point into the DMA accessible memory region */ diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c index a19b5958cee9..2a66e5b7cebc 100644 --- a/drivers/net/mac89x0.c +++ b/drivers/net/mac89x0.c @@ -289,7 +289,7 @@ struct net_device * __init mac89x0_probe(int unit) err = register_netdev(dev); if (err) goto out1; - return 0; + return NULL; out1: nubus_writew(0, dev->base_addr + ADD_PORT); out: diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 95ebe72f320f..451acdca2a21 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c @@ -409,7 +409,7 @@ static inline void mace_clean_rings(struct mace_data *mp) /* free some skb's */ for (i = 0; i < N_RX_RING; ++i) { - if (mp->rx_bufs[i] != 0) { + if (mp->rx_bufs[i] != NULL) { dev_kfree_skb(mp->rx_bufs[i]); mp->rx_bufs[i] = NULL; } @@ -441,7 +441,7 @@ static int mace_open(struct net_device *dev) cp = mp->rx_cmds; for (i = 0; i < N_RX_RING - 1; ++i) { skb = dev_alloc_skb(RX_BUFLEN + 2); - if (skb == 0) { + if (!skb) { data = dummy_buf; } else { skb_reserve(skb, 2); /* so IP header lands on 4-byte bdry */ @@ -903,7 +903,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) out_le16(&cp->command, DBDMA_STOP); /* got a packet, have a look at it */ skb = mp->rx_bufs[i]; - if (skb == 0) { + if (!skb) { ++dev->stats.rx_dropped; } else if (nb > 8) { data = skb->data; @@ -953,9 +953,9 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) break; cp = mp->rx_cmds + i; skb = mp->rx_bufs[i]; - if (skb == 0) { + if (!skb) { skb = dev_alloc_skb(RX_BUFLEN + 2); - if (skb != 0) { + if (skb) { skb_reserve(skb, 2); mp->rx_bufs[i] = skb; } diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 97ba14b759b4..2341b89abc4d 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -354,8 +354,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_free_netdev; } - if (((mem_ptr0 == 0UL) && (mem_len == NETXEN_PCI_128MB_SIZE)) || - (mem_ptr1 == 0UL) || (mem_ptr2 == 0UL)) { + if ((!mem_ptr0 && mem_len == NETXEN_PCI_128MB_SIZE) || + !mem_ptr1 || !mem_ptr2) { DPRINTK(ERR, "Cannot remap adapter memory aborting.:" "0 -> %p, 1 -> %p, 2 -> %p\n", @@ -1337,7 +1337,7 @@ static struct pci_driver netxen_driver = { static int __init netxen_init_module(void) { - if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0) + if ((netxen_workq = create_singlethread_workqueue("netxen")) == NULL) return -ENOMEM; return pci_register_driver(&netxen_driver); diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c index 438f424e6361..8a430a366547 100644 --- a/drivers/net/skfp/hwmtm.c +++ b/drivers/net/skfp/hwmtm.c @@ -1746,7 +1746,7 @@ static void queue_llc_rx(struct s_smc *smc, SMbuf *mb) DB_GEN("queue_llc_rx: mb = %x",(void *)mb,0,4) ; smc->os.hwm.queued_rx_frames++ ; mb->sm_next = (SMbuf *)NULL ; - if (smc->os.hwm.llc_rx_pipe == 0) { + if (smc->os.hwm.llc_rx_pipe == NULL) { smc->os.hwm.llc_rx_pipe = mb ; } else { @@ -1786,7 +1786,7 @@ static void queue_txd_mb(struct s_smc *smc, SMbuf *mb) DB_GEN("_rx: queue_txd_mb = %x",(void *)mb,0,4) ; smc->os.hwm.queued_txd_mb++ ; mb->sm_next = (SMbuf *)NULL ; - if (smc->os.hwm.txd_tx_pipe == 0) { + if (smc->os.hwm.txd_tx_pipe == NULL) { smc->os.hwm.txd_tx_pipe = mb ; } else { diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c index ced2c8f76be7..ffbfb1b79f97 100644 --- a/drivers/net/skfp/smt.c +++ b/drivers/net/skfp/smt.c @@ -712,7 +712,7 @@ void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs) smc->mib.priv.fddiPRIVECF_Reply_Rx++ ; DB_SMT("SMT: received ECF reply from %s\n", addr_to_string(&sm->smt_source),0) ; - if (sm_to_para(smc,sm,SMT_P_ECHODATA) == 0) { + if (sm_to_para(smc,sm,SMT_P_ECHODATA) == NULL) { DB_SMT("SMT: ECHODATA missing\n",0,0) ; break ; } diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 467d80dc3b33..97212799c513 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -3056,7 +3056,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev, netif_carrier_off(dev); gp->regs = ioremap(gemreg_base, gemreg_len); - if (gp->regs == 0UL) { + if (!gp->regs) { printk(KERN_ERR PFX "Cannot map device registers, " "aborting.\n"); err = -EIO; diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 25ce26a882d1..b4e7f30ea4e8 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -3060,7 +3060,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, goto err_out_clear_quattro; } - if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == 0) { + if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) { printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); goto err_out_free_res; } diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index a9f1640884b1..db606b603884 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -12675,7 +12675,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, tg3reg_len = pci_resource_len(pdev, 2); tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len); - if (tp->aperegs == 0UL) { + if (!tp->aperegs) { printk(KERN_ERR PFX "Cannot map APE registers, " "aborting.\n"); err = -ENOMEM; diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 93da3a36cde8..8909050b8ea7 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -2310,7 +2310,7 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) && (tp->acb_head->subcmd == RW_TRC_STATUS_BLOCK)) { - if(tp->ptr_bcn_type != 0) + if(tp->ptr_bcn_type) { *(tp->ptr_bcn_type) = (__u32)((SBlock *)tp->misc_command_data)->BCN_Type; @@ -2980,7 +2980,7 @@ static int smctr_load_firmware(struct net_device *dev) return (UCODE_PRESENT); /* Verify the firmware exists and is there in the right amount. */ - if((tp->ptr_ucode == 0L) + if (!tp->ptr_ucode || (*(tp->ptr_ucode + UCODE_VERSION_OFFSET) < UCODE_VERSION)) { return (UCODE_NOT_PRESENT); diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 37c52e131750..6635ecef36e5 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c @@ -491,13 +491,13 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/ int pos; int timeout = 500000; - if(xc.data == 0x0){ + if (!xc.data) { ret = -EINVAL; break; } data = kmalloc(xc.len, GFP_KERNEL); - if(data == 0x0){ + if (!data) { printk(KERN_WARNING "%s: Failed to allocate memory for copy\n", dev->name); ret = -ENOMEM; break; @@ -1643,7 +1643,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/ * just allocate an skb buff and continue. */ - if(skb == 0x0){ + if (!skb) { nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2); if (nsb) { sc->lmc_rxq[i] = nsb; diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index c9c878cd5c72..8aa461c941ce 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c @@ -1219,10 +1219,6 @@ lmc_t1_watchdog (lmc_softc_t * const sc) static void lmc_set_protocol (lmc_softc_t * const sc, lmc_ctl_t * ctl) { - if (ctl == 0) - { - sc->ictl.keepalive_onoff = LMC_CTL_ON; - - return; - } + if (!ctl) + sc->ictl.keepalive_onoff = LMC_CTL_ON; } diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 99fee2f1d019..57914fbd41d3 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c @@ -2365,17 +2365,17 @@ static void falc_intr(pc300_t * card) static irqreturn_t cpc_intr(int irq, void *dev_id) { - pc300_t *card; + pc300_t *card = dev_id; volatile ucchar plx_status; - if ((card = (pc300_t *) dev_id) == 0) { + if (!card) { #ifdef PC300_DEBUG_INTR printk("cpc_intr: spurious intr %d\n", irq); #endif return IRQ_NONE; /* spurious intr */ } - if (card->hw.rambase == 0) { + if (!card->hw.rambase) { #ifdef PC300_DEBUG_INTR printk("cpc_intr: spurious intr2 %d\n", irq); #endif @@ -3648,7 +3648,7 @@ static void __devexit cpc_remove_one(struct pci_dev *pdev) { pc300_t *card = pci_get_drvdata(pdev); - if (card->hw.rambase != 0) { + if (card->hw.rambase) { int i; /* Disable interrupts on the PCI bridge */ diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index e24a7b095dd6..63abfd72542d 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c @@ -313,7 +313,7 @@ static int cpc_tty_open(struct tty_struct *tty, struct file *flip) if (cpc_tty->num_open == 0) { /* first open of this tty */ if (!cpc_tty_area[port].buf_tx){ cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL); - if (cpc_tty_area[port].buf_tx == 0){ + if (!cpc_tty_area[port].buf_tx) { CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name); return -ENOMEM; } @@ -678,7 +678,7 @@ static void cpc_tty_rx_work(struct work_struct *work) for (j=0; j < CPC_TTY_NPORTS; j++) { cpc_tty = &cpc_tty_area[port]; - if ((buf=cpc_tty->buf_rx.first) != 0) { + if ((buf=cpc_tty->buf_rx.first) != NULL) { if (cpc_tty->tty) { ld = tty_ldisc_ref(cpc_tty->tty); if (ld) { @@ -784,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) } new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); - if (new == 0) { + if (!new) { cpc_tty_rx_disc_frame(pc300chan); continue; } @@ -863,7 +863,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) } new->size = rx_len; new->next = NULL; - if (cpc_tty->buf_rx.first == 0) { + if (cpc_tty->buf_rx.first == NULL) { cpc_tty->buf_rx.first = new; cpc_tty->buf_rx.last = new; } else { @@ -891,7 +891,7 @@ static void cpc_tty_tx_work(struct work_struct *work) CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); - if ((tty = cpc_tty->tty) == 0) { + if ((tty = cpc_tty->tty) == NULL) { CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); return; } @@ -1027,7 +1027,7 @@ void cpc_tty_unregister_service(pc300dev_t *pc300dev) ulong flags; int res; - if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == 0) { + if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == NULL) { CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name); return; } diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 42670acd144b..be9aa4efeca5 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -2032,7 +2032,7 @@ static int mpi_send_packet (struct net_device *dev) /* get a packet to send */ - if ((skb = skb_dequeue(&ai->txq)) == 0) { + if ((skb = skb_dequeue(&ai->txq)) == NULL) { airo_print_err(dev->name, "%s: Dequeue'd zero in send_packet()", __FUNCTION__); diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index bca37bf0f545..7483d45bc5bc 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1073,7 +1073,7 @@ static void xennet_release_rx_bufs(struct netfront_info *np) if (!xen_feature(XENFEAT_auto_translated_physmap)) { /* Do all the remapping work and M2P updates. */ MULTI_mmu_update(mcl, np->rx_mmu, mmu - np->rx_mmu, - 0, DOMID_SELF); + NULL, DOMID_SELF); mcl++; HYPERVISOR_multicall(np->rx_mcl, mcl - np->rx_mcl); } -- cgit v1.2.3 From f305f789bb96ee6e35e71f58324b72abb7bd0b13 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 22 Dec 2007 19:44:00 +0000 Subject: annotate netxen Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- drivers/net/netxen/netxen_nic.h | 4 ++-- drivers/net/netxen/netxen_nic_hw.c | 26 +++++++++++++------------- drivers/net/netxen/netxen_nic_init.c | 7 ++++--- drivers/net/netxen/netxen_nic_main.c | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) (limited to 'drivers/net/netxen/netxen_nic_main.c') diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 724f75560ddb..2bc5eaae141f 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h @@ -898,7 +898,7 @@ struct netxen_adapter { u32 curr_window; u32 cmd_producer; - u32 *cmd_consumer; + __le32 *cmd_consumer; u32 last_cmd_consumer; u32 max_tx_desc_count; @@ -1195,7 +1195,7 @@ dma_watchdog_wakeup(struct netxen_adapter *adapter) int netxen_is_flash_supported(struct netxen_adapter *adapter); -int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]); +int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[]); extern void netxen_change_ringparam(struct netxen_adapter *adapter); extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index a88c51f0879b..01355701bf8e 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -419,7 +419,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) adapter->ctx_desc->cmd_consumer_offset = cpu_to_le64(adapter->ctx_desc_phys_addr + sizeof(struct netxen_ring_ctx)); - adapter->cmd_consumer = (uint32_t *) (((char *)addr) + + adapter->cmd_consumer = (__le32 *) (((char *)addr) + sizeof(struct netxen_ring_ctx)); addr = netxen_alloc(adapter->ahw.pdev, @@ -586,35 +586,35 @@ int netxen_is_flash_supported(struct netxen_adapter *adapter) } static int netxen_get_flash_block(struct netxen_adapter *adapter, int base, - int size, u32 * buf) + int size, __le32 * buf) { int i, addr; - u32 *ptr32; + __le32 *ptr32; + u32 v; addr = base; ptr32 = buf; for (i = 0; i < size / sizeof(u32); i++) { - if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) + if (netxen_rom_fast_read(adapter, addr, &v) == -1) return -1; - *ptr32 = cpu_to_le32(*ptr32); + *ptr32 = cpu_to_le32(v); ptr32++; addr += sizeof(u32); } if ((char *)buf + size > (char *)ptr32) { - u32 local; - - if (netxen_rom_fast_read(adapter, addr, &local) == -1) + __le32 local; + if (netxen_rom_fast_read(adapter, addr, &v) == -1) return -1; - local = cpu_to_le32(local); + local = cpu_to_le32(v); memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32); } return 0; } -int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) +int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[]) { - u32 *pmac = (u32 *) & mac[0]; + __le32 *pmac = (__le32 *) & mac[0]; if (netxen_get_flash_block(adapter, NETXEN_USER_START + @@ -623,7 +623,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) { return -1; } - if (*mac == ~0ULL) { + if (*mac == cpu_to_le64(~0ULL)) { if (netxen_get_flash_block(adapter, NETXEN_USER_START_OLD + offsetof(struct netxen_user_old_info, @@ -631,7 +631,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) return -1; - if (*mac == ~0ULL) + if (*mac == cpu_to_le64(~0ULL)) return -1; } return 0; diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 74685a1a0b71..9e38bcb3fba9 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c @@ -438,10 +438,11 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr, int ret = 0; for (addridx = addr; addridx < (addr + size); addridx += 4) { - ret = do_rom_fast_read(adapter, addridx, (int *)bytes); + int v; + ret = do_rom_fast_read(adapter, addridx, &v); if (ret != 0) break; - *(int *)bytes = cpu_to_le32(*(int *)bytes); + *(__le32 *)bytes = cpu_to_le32(v); bytes += 4; } @@ -501,7 +502,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, int timeout = 0; int data; - data = le32_to_cpu((*(u32*)bytes)); + data = le32_to_cpu((*(__le32*)bytes)); ret = do_rom_fast_write(adapter, addridx, data); if (ret < 0) return ret; diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 2341b89abc4d..9737eae5ef11 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -277,7 +277,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct netxen_recv_context *recv_ctx = NULL; struct netxen_rcv_desc_ctx *rcv_desc = NULL; struct netxen_cmd_buffer *cmd_buf_arr = NULL; - u64 mac_addr[FLASH_NUM_PORTS + 1]; + __le64 mac_addr[FLASH_NUM_PORTS + 1]; int valid_mac = 0; u32 val; int pci_func_id = PCI_FUNC(pdev->devfn); -- cgit v1.2.3