* Re: [PATCH] cxgb3: remove pointless conditional before kfree_skb()
@ 2012-08-28 14:19 Wei Yongjun
0 siblings, 0 replies; 3+ messages in thread
From: Wei Yongjun @ 2012-08-28 14:19 UTC (permalink / raw)
To: David.Laight; +Cc: divy, yongjun_wei, netdev
On 08/28/2012 09:24 PM, David Laight wrote:
>> - if (t->nofail_skb)
>> - kfree_skb(t->nofail_skb);
>> + kfree_skb(t->nofail_skb);
> Some of these conditionals might be there for performance
> reasons - eg if common path and normally NULL.
I have a quick look at those code, cxgb3_offload_deactivate()
is only used when remove device or device error and then disable
the device, so maybe it is not a common path.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] cxgb3: remove pointless conditional before kfree_skb()
@ 2012-08-28 13:04 Wei Yongjun
2012-08-28 13:24 ` David Laight
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-08-28 13:04 UTC (permalink / raw)
To: divy; +Cc: yongjun_wei, netdev
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Remove pointless conditional before kfree_skb().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 3 +--
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
index 2dbbcbb..aac26f2 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
@@ -1341,8 +1341,7 @@ void cxgb3_offload_deactivate(struct adapter *adapter)
rcu_read_unlock();
RCU_INIT_POINTER(tdev->l2opt, NULL);
call_rcu(&d->rcu_head, clean_l2_data);
- if (t->nofail_skb)
- kfree_skb(t->nofail_skb);
+ kfree_skb(t->nofail_skb);
kfree(t);
}
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 6505070..0b79309 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -3412,8 +3412,7 @@ static void __devexit remove_one(struct pci_dev *pdev)
free_netdev(adapter->port[i]);
iounmap(adapter->regs);
- if (adapter->nofail_skb)
- kfree_skb(adapter->nofail_skb);
+ kfree_skb(adapter->nofail_skb);
kfree(adapter);
pci_release_regions(pdev);
pci_disable_device(pdev);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-28 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-28 14:19 [PATCH] cxgb3: remove pointless conditional before kfree_skb() Wei Yongjun
-- strict thread matches above, loose matches on Subject: below --
2012-08-28 13:04 Wei Yongjun
2012-08-28 13:24 ` David Laight
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).