netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] sky2: Remove failure cases for sky2_rx_start
@ 2010-01-27 15:05 Mike McCormack
  2010-01-27 17:10 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Mike McCormack @ 2010-01-27 15:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

sky2_rx_start() can no longer fail, so remove redundant code pathes.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
---
 drivers/net/sky2.c |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index a967912..6ea660f 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1366,7 +1366,7 @@ static inline void sky2_rx_update(struct sky2_port *sky2, unsigned rxq)
  * One element is used for checksum enable/disable, and one
  * extra to avoid wrap.
  */
-static int sky2_rx_start(struct sky2_port *sky2)
+static void sky2_rx_start(struct sky2_port *sky2)
 {
 	struct sky2_hw *hw = sky2->hw;
 	struct rx_ring_info *re;
@@ -1392,7 +1392,6 @@ static int sky2_rx_start(struct sky2_port *sky2)
 	if (!(hw->flags & SKY2_HW_NEW_LE))
 		rx_set_checksum(sky2);
 
-
 	/* submit Rx ring */
 	for (i = 0; i < sky2->rx_pending; i++) {
 		re = sky2->rx_ring + i;
@@ -1437,10 +1436,6 @@ static int sky2_rx_start(struct sky2_port *sky2)
 		sky2_write32(hw, Q_ADDR(txqaddr[sky2->port], Q_TEST),
 			     TBMU_TEST_HOME_ADD_FIX_EN | TBMU_TEST_ROUTING_ADD_FIX_EN);
 	}
-
-
-
-	return 0;
 }
 
 static int sky2_alloc_buffers(struct sky2_port *sky2)
@@ -1590,9 +1585,7 @@ static int sky2_up(struct net_device *dev)
 	sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
 #endif
 
-	err = sky2_rx_start(sky2);
-	if (err)
-		goto err_out;
+	sky2_rx_start(sky2);
 
 	/* Enable interrupts from phy/mac for port */
 	imask = sky2_read32(hw, B0_IMSK);
@@ -2200,7 +2193,6 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
 	struct sky2_port *sky2 = netdev_priv(dev);
 	struct sky2_hw *hw = sky2->hw;
 	unsigned port = sky2->port;
-	int err;
 	u16 ctl, mode;
 	u32 imask;
 
@@ -2246,21 +2238,17 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
 
 	sky2_write8(hw, RB_ADDR(rxqaddr[port], RB_CTRL), RB_ENA_OP_MD);
 
-	err = sky2_rx_start(sky2);
+	sky2_rx_start(sky2);
 	sky2_write32(hw, B0_IMSK, imask);
 
 	sky2_read32(hw, B0_Y2_SP_LISR);
 	napi_enable(&hw->napi);
 
-	if (err)
-		dev_close(dev);
-	else {
-		gma_write16(hw, port, GM_GP_CTRL, ctl);
+	gma_write16(hw, port, GM_GP_CTRL, ctl);
 
-		netif_wake_queue(dev);
-	}
+	netif_wake_queue(dev);
 
-	return err;
+	return 0;
 }
 
 /* For small just reuse existing skb for next receive */
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] sky2: Remove failure cases for sky2_rx_start
  2010-01-27 15:05 [PATCH 3/3] sky2: Remove failure cases for sky2_rx_start Mike McCormack
@ 2010-01-27 17:10 ` Stephen Hemminger
  2010-01-27 22:30   ` Mike McCormack
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2010-01-27 17:10 UTC (permalink / raw)
  To: Mike McCormack; +Cc: netdev

On Thu, 28 Jan 2010 00:05:54 +0900
Mike McCormack <mikem@ring3k.org> wrote:

> sky2_rx_start() can no longer fail, so remove redundant code pathes.
> 
> Signed-off-by: Mike McCormack <mikem@ring3k.org>

This can't work right if MTU is increased. The buffers need to be reallocated
in change_mtu(); and yes it could fail when getting the new buffers.


-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] sky2: Remove failure cases for sky2_rx_start
  2010-01-27 17:10 ` Stephen Hemminger
@ 2010-01-27 22:30   ` Mike McCormack
  0 siblings, 0 replies; 3+ messages in thread
From: Mike McCormack @ 2010-01-27 22:30 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

2010/1/28 Stephen Hemminger <shemminger@vyatta.com>:
> On Thu, 28 Jan 2010 00:05:54 +0900
> Mike McCormack <mikem@ring3k.org> wrote:
>
>> sky2_rx_start() can no longer fail, so remove redundant code pathes.
>>
>> Signed-off-by: Mike McCormack <mikem@ring3k.org>
>
> This can't work right if MTU is increased. The buffers need to be reallocated
> in change_mtu(); and yes it could fail when getting the new buffers.

Thanks for the feedback.  I will rework the patches.

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-27 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27 15:05 [PATCH 3/3] sky2: Remove failure cases for sky2_rx_start Mike McCormack
2010-01-27 17:10 ` Stephen Hemminger
2010-01-27 22:30   ` Mike McCormack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).