aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/defxx.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-23 01:40:09 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-26 21:34:29 -0400
commit807540baae406c84dcb9c1c8ef07a56d2d2ae84a (patch)
treeccd5c2cb57710dd6b73cf8df11eedf67abc14ae4 /drivers/net/defxx.c
parentcb4dfe562cac6fcb544df752e40c1d78000d0712 (diff)
drivers/net: return operator cleanup
Change "return (EXPR);" to "return EXPR;" return is not a function, parentheses are not required. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/defxx.c')
-rw-r--r--drivers/net/defxx.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index e5667c55844e..417e14385623 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -1024,7 +1024,7 @@ static int __devinit dfx_driver_init(struct net_device *dev,
1024 &data) != DFX_K_SUCCESS) { 1024 &data) != DFX_K_SUCCESS) {
1025 printk("%s: Could not read adapter factory MAC address!\n", 1025 printk("%s: Could not read adapter factory MAC address!\n",
1026 print_name); 1026 print_name);
1027 return(DFX_K_FAILURE); 1027 return DFX_K_FAILURE;
1028 } 1028 }
1029 le32 = cpu_to_le32(data); 1029 le32 = cpu_to_le32(data);
1030 memcpy(&bp->factory_mac_addr[0], &le32, sizeof(u32)); 1030 memcpy(&bp->factory_mac_addr[0], &le32, sizeof(u32));
@@ -1033,7 +1033,7 @@ static int __devinit dfx_driver_init(struct net_device *dev,
1033 &data) != DFX_K_SUCCESS) { 1033 &data) != DFX_K_SUCCESS) {
1034 printk("%s: Could not read adapter factory MAC address!\n", 1034 printk("%s: Could not read adapter factory MAC address!\n",
1035 print_name); 1035 print_name);
1036 return(DFX_K_FAILURE); 1036 return DFX_K_FAILURE;
1037 } 1037 }
1038 le32 = cpu_to_le32(data); 1038 le32 = cpu_to_le32(data);
1039 memcpy(&bp->factory_mac_addr[4], &le32, sizeof(u16)); 1039 memcpy(&bp->factory_mac_addr[4], &le32, sizeof(u16));
@@ -1075,7 +1075,7 @@ static int __devinit dfx_driver_init(struct net_device *dev,
1075 if (top_v == NULL) { 1075 if (top_v == NULL) {
1076 printk("%s: Could not allocate memory for host buffers " 1076 printk("%s: Could not allocate memory for host buffers "
1077 "and structures!\n", print_name); 1077 "and structures!\n", print_name);
1078 return(DFX_K_FAILURE); 1078 return DFX_K_FAILURE;
1079 } 1079 }
1080 memset(top_v, 0, alloc_size); /* zero out memory before continuing */ 1080 memset(top_v, 0, alloc_size); /* zero out memory before continuing */
1081 top_p = bp->kmalloced_dma; /* get physical address of buffer */ 1081 top_p = bp->kmalloced_dma; /* get physical address of buffer */
@@ -1145,7 +1145,7 @@ static int __devinit dfx_driver_init(struct net_device *dev,
1145 DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", 1145 DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n",
1146 print_name, (long)bp->cons_block_virt, bp->cons_block_phys); 1146 print_name, (long)bp->cons_block_virt, bp->cons_block_phys);
1147 1147
1148 return(DFX_K_SUCCESS); 1148 return DFX_K_SUCCESS;
1149} 1149}
1150 1150
1151 1151
@@ -1195,7 +1195,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1195 if (dfx_hw_dma_uninit(bp, bp->reset_type) != DFX_K_SUCCESS) 1195 if (dfx_hw_dma_uninit(bp, bp->reset_type) != DFX_K_SUCCESS)
1196 { 1196 {
1197 printk("%s: Could not uninitialize/reset adapter!\n", bp->dev->name); 1197 printk("%s: Could not uninitialize/reset adapter!\n", bp->dev->name);
1198 return(DFX_K_FAILURE); 1198 return DFX_K_FAILURE;
1199 } 1199 }
1200 1200
1201 /* 1201 /*
@@ -1229,7 +1229,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1229 NULL) != DFX_K_SUCCESS) 1229 NULL) != DFX_K_SUCCESS)
1230 { 1230 {
1231 printk("%s: Could not set adapter burst size!\n", bp->dev->name); 1231 printk("%s: Could not set adapter burst size!\n", bp->dev->name);
1232 return(DFX_K_FAILURE); 1232 return DFX_K_FAILURE;
1233 } 1233 }
1234 1234
1235 /* 1235 /*
@@ -1246,7 +1246,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1246 NULL) != DFX_K_SUCCESS) 1246 NULL) != DFX_K_SUCCESS)
1247 { 1247 {
1248 printk("%s: Could not set consumer block address!\n", bp->dev->name); 1248 printk("%s: Could not set consumer block address!\n", bp->dev->name);
1249 return(DFX_K_FAILURE); 1249 return DFX_K_FAILURE;
1250 } 1250 }
1251 1251
1252 /* 1252 /*
@@ -1278,7 +1278,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1278 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 1278 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
1279 { 1279 {
1280 printk("%s: DMA command request failed!\n", bp->dev->name); 1280 printk("%s: DMA command request failed!\n", bp->dev->name);
1281 return(DFX_K_FAILURE); 1281 return DFX_K_FAILURE;
1282 } 1282 }
1283 1283
1284 /* Set the initial values for eFDXEnable and MACTReq MIB objects */ 1284 /* Set the initial values for eFDXEnable and MACTReq MIB objects */
@@ -1294,7 +1294,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1294 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 1294 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
1295 { 1295 {
1296 printk("%s: DMA command request failed!\n", bp->dev->name); 1296 printk("%s: DMA command request failed!\n", bp->dev->name);
1297 return(DFX_K_FAILURE); 1297 return DFX_K_FAILURE;
1298 } 1298 }
1299 1299
1300 /* Initialize adapter CAM */ 1300 /* Initialize adapter CAM */
@@ -1302,7 +1302,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1302 if (dfx_ctl_update_cam(bp) != DFX_K_SUCCESS) 1302 if (dfx_ctl_update_cam(bp) != DFX_K_SUCCESS)
1303 { 1303 {
1304 printk("%s: Adapter CAM update failed!\n", bp->dev->name); 1304 printk("%s: Adapter CAM update failed!\n", bp->dev->name);
1305 return(DFX_K_FAILURE); 1305 return DFX_K_FAILURE;
1306 } 1306 }
1307 1307
1308 /* Initialize adapter filters */ 1308 /* Initialize adapter filters */
@@ -1310,7 +1310,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1310 if (dfx_ctl_update_filters(bp) != DFX_K_SUCCESS) 1310 if (dfx_ctl_update_filters(bp) != DFX_K_SUCCESS)
1311 { 1311 {
1312 printk("%s: Adapter filters update failed!\n", bp->dev->name); 1312 printk("%s: Adapter filters update failed!\n", bp->dev->name);
1313 return(DFX_K_FAILURE); 1313 return DFX_K_FAILURE;
1314 } 1314 }
1315 1315
1316 /* 1316 /*
@@ -1328,7 +1328,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1328 printk("%s: Receive buffer allocation failed\n", bp->dev->name); 1328 printk("%s: Receive buffer allocation failed\n", bp->dev->name);
1329 if (get_buffers) 1329 if (get_buffers)
1330 dfx_rcv_flush(bp); 1330 dfx_rcv_flush(bp);
1331 return(DFX_K_FAILURE); 1331 return DFX_K_FAILURE;
1332 } 1332 }
1333 1333
1334 /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */ 1334 /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */
@@ -1339,13 +1339,13 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
1339 printk("%s: Start command failed\n", bp->dev->name); 1339 printk("%s: Start command failed\n", bp->dev->name);
1340 if (get_buffers) 1340 if (get_buffers)
1341 dfx_rcv_flush(bp); 1341 dfx_rcv_flush(bp);
1342 return(DFX_K_FAILURE); 1342 return DFX_K_FAILURE;
1343 } 1343 }
1344 1344
1345 /* Initialization succeeded, reenable PDQ interrupts */ 1345 /* Initialization succeeded, reenable PDQ interrupts */
1346 1346
1347 dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_ENABLE_DEF_INTS); 1347 dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_ENABLE_DEF_INTS);
1348 return(DFX_K_SUCCESS); 1348 return DFX_K_SUCCESS;
1349 } 1349 }
1350 1350
1351 1351
@@ -1434,7 +1434,7 @@ static int dfx_open(struct net_device *dev)
1434 1434
1435 /* Set device structure info */ 1435 /* Set device structure info */
1436 netif_start_queue(dev); 1436 netif_start_queue(dev);
1437 return(0); 1437 return 0;
1438} 1438}
1439 1439
1440 1440
@@ -1526,7 +1526,7 @@ static int dfx_close(struct net_device *dev)
1526 1526
1527 free_irq(dev->irq, dev); 1527 free_irq(dev->irq, dev);
1528 1528
1529 return(0); 1529 return 0;
1530} 1530}
1531 1531
1532 1532
@@ -2027,7 +2027,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev)
2027 2027
2028 bp->cmd_req_virt->cmd_type = PI_CMD_K_SMT_MIB_GET; 2028 bp->cmd_req_virt->cmd_type = PI_CMD_K_SMT_MIB_GET;
2029 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 2029 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
2030 return((struct net_device_stats *) &bp->stats); 2030 return (struct net_device_stats *)&bp->stats;
2031 2031
2032 /* Fill the bp->stats structure with the SMT MIB object values */ 2032 /* Fill the bp->stats structure with the SMT MIB object values */
2033 2033
@@ -2128,7 +2128,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev)
2128 2128
2129 bp->cmd_req_virt->cmd_type = PI_CMD_K_CNTRS_GET; 2129 bp->cmd_req_virt->cmd_type = PI_CMD_K_CNTRS_GET;
2130 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 2130 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
2131 return((struct net_device_stats *) &bp->stats); 2131 return (struct net_device_stats *)&bp->stats;
2132 2132
2133 /* Fill the bp->stats structure with the FDDI counter values */ 2133 /* Fill the bp->stats structure with the FDDI counter values */
2134 2134
@@ -2144,7 +2144,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev)
2144 bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls; 2144 bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls;
2145 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; 2145 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls;
2146 2146
2147 return((struct net_device_stats *) &bp->stats); 2147 return (struct net_device_stats *)&bp->stats;
2148 } 2148 }
2149 2149
2150 2150
@@ -2354,7 +2354,7 @@ static int dfx_ctl_set_mac_address(struct net_device *dev, void *addr)
2354 { 2354 {
2355 DBG_printk("%s: Adapter CAM updated with new MAC address\n", dev->name); 2355 DBG_printk("%s: Adapter CAM updated with new MAC address\n", dev->name);
2356 } 2356 }
2357 return(0); /* always return zero */ 2357 return 0; /* always return zero */
2358 } 2358 }
2359 2359
2360 2360
@@ -2438,8 +2438,8 @@ static int dfx_ctl_update_cam(DFX_board_t *bp)
2438 /* Issue command to update adapter CAM, then return */ 2438 /* Issue command to update adapter CAM, then return */
2439 2439
2440 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 2440 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
2441 return(DFX_K_FAILURE); 2441 return DFX_K_FAILURE;
2442 return(DFX_K_SUCCESS); 2442 return DFX_K_SUCCESS;
2443 } 2443 }
2444 2444
2445 2445
@@ -2504,8 +2504,8 @@ static int dfx_ctl_update_filters(DFX_board_t *bp)
2504 /* Issue command to update adapter filters, then return */ 2504 /* Issue command to update adapter filters, then return */
2505 2505
2506 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) 2506 if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS)
2507 return(DFX_K_FAILURE); 2507 return DFX_K_FAILURE;
2508 return(DFX_K_SUCCESS); 2508 return DFX_K_SUCCESS;
2509 } 2509 }
2510 2510
2511 2511
@@ -2561,7 +2561,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
2561 (status == PI_STATE_K_HALTED) || 2561 (status == PI_STATE_K_HALTED) ||
2562 (status == PI_STATE_K_DMA_UNAVAIL) || 2562 (status == PI_STATE_K_DMA_UNAVAIL) ||
2563 (status == PI_STATE_K_UPGRADE)) 2563 (status == PI_STATE_K_UPGRADE))
2564 return(DFX_K_OUTSTATE); 2564 return DFX_K_OUTSTATE;
2565 2565
2566 /* Put response buffer on the command response queue */ 2566 /* Put response buffer on the command response queue */
2567 2567
@@ -2599,7 +2599,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
2599 udelay(100); /* wait for 100 microseconds */ 2599 udelay(100); /* wait for 100 microseconds */
2600 } 2600 }
2601 if (timeout_cnt == 0) 2601 if (timeout_cnt == 0)
2602 return(DFX_K_HW_TIMEOUT); 2602 return DFX_K_HW_TIMEOUT;
2603 2603
2604 /* Bump (and wrap) the completion index and write out to register */ 2604 /* Bump (and wrap) the completion index and write out to register */
2605 2605
@@ -2619,14 +2619,14 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
2619 udelay(100); /* wait for 100 microseconds */ 2619 udelay(100); /* wait for 100 microseconds */
2620 } 2620 }
2621 if (timeout_cnt == 0) 2621 if (timeout_cnt == 0)
2622 return(DFX_K_HW_TIMEOUT); 2622 return DFX_K_HW_TIMEOUT;
2623 2623
2624 /* Bump (and wrap) the completion index and write out to register */ 2624 /* Bump (and wrap) the completion index and write out to register */
2625 2625
2626 bp->cmd_rsp_reg.index.comp += 1; 2626 bp->cmd_rsp_reg.index.comp += 1;
2627 bp->cmd_rsp_reg.index.comp &= PI_CMD_RSP_K_NUM_ENTRIES-1; 2627 bp->cmd_rsp_reg.index.comp &= PI_CMD_RSP_K_NUM_ENTRIES-1;
2628 dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword); 2628 dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword);
2629 return(DFX_K_SUCCESS); 2629 return DFX_K_SUCCESS;
2630 } 2630 }
2631 2631
2632 2632
@@ -2700,7 +2700,7 @@ static int dfx_hw_port_ctrl_req(
2700 udelay(100); /* wait for 100 microseconds */ 2700 udelay(100); /* wait for 100 microseconds */
2701 } 2701 }
2702 if (timeout_cnt == 0) 2702 if (timeout_cnt == 0)
2703 return(DFX_K_HW_TIMEOUT); 2703 return DFX_K_HW_TIMEOUT;
2704 2704
2705 /* 2705 /*
2706 * If the address of host_data is non-zero, assume caller has supplied a 2706 * If the address of host_data is non-zero, assume caller has supplied a
@@ -2710,7 +2710,7 @@ static int dfx_hw_port_ctrl_req(
2710 2710
2711 if (host_data != NULL) 2711 if (host_data != NULL)
2712 dfx_port_read_long(bp, PI_PDQ_K_REG_HOST_DATA, host_data); 2712 dfx_port_read_long(bp, PI_PDQ_K_REG_HOST_DATA, host_data);
2713 return(DFX_K_SUCCESS); 2713 return DFX_K_SUCCESS;
2714 } 2714 }
2715 2715
2716 2716
@@ -2800,7 +2800,7 @@ static int dfx_hw_adap_state_rd(DFX_board_t *bp)
2800 PI_UINT32 port_status; /* Port Status register value */ 2800 PI_UINT32 port_status; /* Port Status register value */
2801 2801
2802 dfx_port_read_long(bp, PI_PDQ_K_REG_PORT_STATUS, &port_status); 2802 dfx_port_read_long(bp, PI_PDQ_K_REG_PORT_STATUS, &port_status);
2803 return((port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE); 2803 return (port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE;
2804 } 2804 }
2805 2805
2806 2806
@@ -2852,8 +2852,8 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type)
2852 udelay(100); /* wait for 100 microseconds */ 2852 udelay(100); /* wait for 100 microseconds */
2853 } 2853 }
2854 if (timeout_cnt == 0) 2854 if (timeout_cnt == 0)
2855 return(DFX_K_HW_TIMEOUT); 2855 return DFX_K_HW_TIMEOUT;
2856 return(DFX_K_SUCCESS); 2856 return DFX_K_SUCCESS;
2857 } 2857 }
2858 2858
2859/* 2859/*