Patchwork wan: remove some pointless conditionals before kfree_skb()

login
register
mail settings
Submitter Wei Yongjun
Date Feb. 25, 2009, 10:22 a.m.
Message ID <49A51BF1.2030503@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/23695/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - Feb. 25, 2009, 10:22 a.m.
Remove some pointless conditionals before kfree_skb().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 drivers/net/wan/cosa.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Jan Yenya Kasprzak - Feb. 25, 2009, 3:42 p.m.
Wei Yongjun wrote:
: Remove some pointless conditionals before kfree_skb().
: 
: Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Acked-by: Jan "Yenya" Kasprzak <kas@fi.muni.cz>

Thanks,

-Yenya

: ---
:  drivers/net/wan/cosa.c |    3 +--
:  1 files changed, 1 insertions(+), 2 deletions(-)
: 
: diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
: index 0d7ba11..d276d72 100644
: --- a/drivers/net/wan/cosa.c
: +++ b/drivers/net/wan/cosa.c
: @@ -731,8 +731,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)
:  	 * We can safely fall back to non-dma-able memory, because we have
:  	 * the cosa->bouncebuf pre-allocated.
:  	 */
: -	if (chan->rx_skb)
: -		kfree_skb(chan->rx_skb);
: +	kfree_skb(chan->rx_skb);
:  	chan->rx_skb = dev_alloc_skb(size);
:  	if (chan->rx_skb == NULL) {
:  		printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",
: -- 
: 1.5.3.8
: 
: 
:
David Miller - Feb. 27, 2009, 7:08 a.m.
From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Wed, 25 Feb 2009 18:22:41 +0800

> Remove some pointless conditionals before kfree_skb().
> 
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 0d7ba11..d276d72 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -731,8 +731,7 @@  static char *cosa_net_setup_rx(struct channel_data *chan, int size)
 	 * We can safely fall back to non-dma-able memory, because we have
 	 * the cosa->bouncebuf pre-allocated.
 	 */
-	if (chan->rx_skb)
-		kfree_skb(chan->rx_skb);
+	kfree_skb(chan->rx_skb);
 	chan->rx_skb = dev_alloc_skb(size);
 	if (chan->rx_skb == NULL) {
 		printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",