S2IO: Checking for the return value of pci map function

- Checking for the return value of pci map function
 - Implemented Francois Romieu's comments on eliminating code duplication
   using goto
 - Implemented Francois Romieu's comments on using a temporary variable for
   accessing statistics structure

Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Veena Parat
2007-07-23 02:37:14 -04:00
committed by Jeff Garzik
parent eccb8628ab
commit 491abf2537
2 changed files with 79 additions and 3 deletions

View File

@ -74,6 +74,10 @@ static int debug_level = ERR_DBG;
/* DEBUG message print. */
#define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args)
#ifndef DMA_ERROR_CODE
#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
#endif
/* Protocol assist features of the NIC */
#define L3_CKSUM_OK 0xFFFF
#define L4_CKSUM_OK 0xFFFF
@ -97,6 +101,7 @@ struct swStat {
unsigned long long num_aggregations;
/* Other statistics */
unsigned long long mem_alloc_fail_cnt;
unsigned long long pci_map_fail_cnt;
unsigned long long watchdog_timer_cnt;
unsigned long long mem_allocated;
unsigned long long mem_freed;