aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 07:48:46 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-03 09:53:48 -0400
commitbc3c90a2b70652b87cde8de65275d6f41d0f24c3 (patch)
tree3d9a7eebad85bc86f5a3fbd4fdf4cc2b7be950a4 /drivers/net/sfc/falcon.c
parentc1e5fcc980b7b2185b29e4f9f0d8266806ada9eb (diff)
sfc: Remove some unreachable error paths
Some functions return an error code which is always 0. Change their return types to void and simplify their callers accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r--drivers/net/sfc/falcon.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 96cb5d031ed7..e66d6cf03adc 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -242,7 +242,7 @@ static struct i2c_algo_bit_data falcon_i2c_bit_operations = {
242 * falcon_alloc_special_buffer()) in Falcon's buffer table, allowing 242 * falcon_alloc_special_buffer()) in Falcon's buffer table, allowing
243 * it to be used for event queues, descriptor rings etc. 243 * it to be used for event queues, descriptor rings etc.
244 */ 244 */
245static int 245static void
246falcon_init_special_buffer(struct efx_nic *efx, 246falcon_init_special_buffer(struct efx_nic *efx,
247 struct efx_special_buffer *buffer) 247 struct efx_special_buffer *buffer)
248{ 248{
@@ -266,8 +266,6 @@ falcon_init_special_buffer(struct efx_nic *efx,
266 BUF_OWNER_ID_FBUF, 0); 266 BUF_OWNER_ID_FBUF, 0);
267 falcon_write_sram(efx, &buf_desc, index); 267 falcon_write_sram(efx, &buf_desc, index);
268 } 268 }
269
270 return 0;
271} 269}
272 270
273/* Unmaps a buffer from Falcon and clears the buffer table entries */ 271/* Unmaps a buffer from Falcon and clears the buffer table entries */
@@ -449,16 +447,13 @@ int falcon_probe_tx(struct efx_tx_queue *tx_queue)
449 sizeof(efx_qword_t)); 447 sizeof(efx_qword_t));
450} 448}
451 449
452int falcon_init_tx(struct efx_tx_queue *tx_queue) 450void falcon_init_tx(struct efx_tx_queue *tx_queue)
453{ 451{
454 efx_oword_t tx_desc_ptr; 452 efx_oword_t tx_desc_ptr;
455 struct efx_nic *efx = tx_queue->efx; 453 struct efx_nic *efx = tx_queue->efx;
456 int rc;
457 454
458 /* Pin TX descriptor ring */ 455 /* Pin TX descriptor ring */
459 rc = falcon_init_special_buffer(efx, &tx_queue->txd); 456 falcon_init_special_buffer(efx, &tx_queue->txd);
460 if (rc)
461 return rc;
462 457
463 /* Push TX descriptor ring to card */ 458 /* Push TX descriptor ring to card */
464 EFX_POPULATE_OWORD_10(tx_desc_ptr, 459 EFX_POPULATE_OWORD_10(tx_desc_ptr,
@@ -495,8 +490,6 @@ int falcon_init_tx(struct efx_tx_queue *tx_queue)
495 set_bit_le(tx_queue->queue, (void *)&reg); 490 set_bit_le(tx_queue->queue, (void *)&reg);
496 falcon_write(efx, &reg, TX_CHKSM_CFG_REG_KER_A1); 491 falcon_write(efx, &reg, TX_CHKSM_CFG_REG_KER_A1);
497 } 492 }
498
499 return 0;
500} 493}
501 494
502static int falcon_flush_tx_queue(struct efx_tx_queue *tx_queue) 495static int falcon_flush_tx_queue(struct efx_tx_queue *tx_queue)
@@ -639,11 +632,10 @@ int falcon_probe_rx(struct efx_rx_queue *rx_queue)
639 sizeof(efx_qword_t)); 632 sizeof(efx_qword_t));
640} 633}
641 634
642int falcon_init_rx(struct efx_rx_queue *rx_queue) 635void falcon_init_rx(struct efx_rx_queue *rx_queue)
643{ 636{
644 efx_oword_t rx_desc_ptr; 637 efx_oword_t rx_desc_ptr;
645 struct efx_nic *efx = rx_queue->efx; 638 struct efx_nic *efx = rx_queue->efx;
646 int rc;
647 bool is_b0 = falcon_rev(efx) >= FALCON_REV_B0; 639 bool is_b0 = falcon_rev(efx) >= FALCON_REV_B0;
648 bool iscsi_digest_en = is_b0; 640 bool iscsi_digest_en = is_b0;
649 641
@@ -652,9 +644,7 @@ int falcon_init_rx(struct efx_rx_queue *rx_queue)
652 rx_queue->rxd.index + rx_queue->rxd.entries - 1); 644 rx_queue->rxd.index + rx_queue->rxd.entries - 1);
653 645
654 /* Pin RX descriptor ring */ 646 /* Pin RX descriptor ring */
655 rc = falcon_init_special_buffer(efx, &rx_queue->rxd); 647 falcon_init_special_buffer(efx, &rx_queue->rxd);
656 if (rc)
657 return rc;
658 648
659 /* Push RX descriptor ring to card */ 649 /* Push RX descriptor ring to card */
660 EFX_POPULATE_OWORD_10(rx_desc_ptr, 650 EFX_POPULATE_OWORD_10(rx_desc_ptr,
@@ -671,7 +661,6 @@ int falcon_init_rx(struct efx_rx_queue *rx_queue)
671 RX_DESCQ_EN, 1); 661 RX_DESCQ_EN, 1);
672 falcon_write_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, 662 falcon_write_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base,
673 rx_queue->queue); 663 rx_queue->queue);
674 return 0;
675} 664}
676 665
677static int falcon_flush_rx_queue(struct efx_rx_queue *rx_queue) 666static int falcon_flush_rx_queue(struct efx_rx_queue *rx_queue)
@@ -1205,20 +1194,17 @@ int falcon_probe_eventq(struct efx_channel *channel)
1205 return falcon_alloc_special_buffer(efx, &channel->eventq, evq_size); 1194 return falcon_alloc_special_buffer(efx, &channel->eventq, evq_size);
1206} 1195}
1207 1196
1208int falcon_init_eventq(struct efx_channel *channel) 1197void falcon_init_eventq(struct efx_channel *channel)
1209{ 1198{
1210 efx_oword_t evq_ptr; 1199 efx_oword_t evq_ptr;
1211 struct efx_nic *efx = channel->efx; 1200 struct efx_nic *efx = channel->efx;
1212 int rc;
1213 1201
1214 EFX_LOG(efx, "channel %d event queue in special buffers %d-%d\n", 1202 EFX_LOG(efx, "channel %d event queue in special buffers %d-%d\n",
1215 channel->channel, channel->eventq.index, 1203 channel->channel, channel->eventq.index,
1216 channel->eventq.index + channel->eventq.entries - 1); 1204 channel->eventq.index + channel->eventq.entries - 1);
1217 1205
1218 /* Pin event queue buffer */ 1206 /* Pin event queue buffer */
1219 rc = falcon_init_special_buffer(efx, &channel->eventq); 1207 falcon_init_special_buffer(efx, &channel->eventq);
1220 if (rc)
1221 return rc;
1222 1208
1223 /* Fill event queue with all ones (i.e. empty events) */ 1209 /* Fill event queue with all ones (i.e. empty events) */
1224 memset(channel->eventq.addr, 0xff, channel->eventq.len); 1210 memset(channel->eventq.addr, 0xff, channel->eventq.len);
@@ -1232,8 +1218,6 @@ int falcon_init_eventq(struct efx_channel *channel)
1232 channel->channel); 1218 channel->channel);
1233 1219
1234 falcon_set_int_moderation(channel); 1220 falcon_set_int_moderation(channel);
1235
1236 return 0;
1237} 1221}
1238 1222
1239void falcon_fini_eventq(struct efx_channel *channel) 1223void falcon_fini_eventq(struct efx_channel *channel)