Skip to contentSkip to conversation

Staging: netlogic: Remove unused function

PATCH In review Bhumika Goyal 2 participants 2 messages Sep 15, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: netlogic: Remove unused function

The function xlr_wakeup_queue is not used anywhere in the kernel. Therefore, remove it. The static unused functions were detected using Coccinelle but the change was done by hand. Script used:

@initialize:python@
@@
def display(name,p):

	print(name,p[0].file)

@r1@
identifier func;
type T;
position p;
@@
static T func@p(...)
{
...
}

@r@
identifier r1.func;
@@
func

@script:python depends on !r@
func << r1.func;
p << r1.p;
@@
display(func,p)

---
Changes in v2:
* Simplify coccinelle script by removing func(...) and adding spaces around "<<"

 drivers/staging/netlogic/xlr_net.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/netlogic/xlr_net.c +0 -10
index 7db88aa..552a7dc 100644
@@ -269,16 +269,6 @@ static void xlr_make_tx_desc(struct nlm_fmn_msg *msg, unsigned long addr,
 	msg->msg3 = 0;
 }
 
-static void __maybe_unused xlr_wakeup_queue(unsigned long dev)
-{
-	struct net_device *ndev = (struct net_device *)dev;
-	struct xlr_net_priv *priv = netdev_priv(ndev);
-	struct phy_device *phydev = xlr_get_phydev(priv);
-
-	if (phydev->link)
-		netif_tx_wake_queue(netdev_get_tx_queue(ndev, priv->wakeup_q));
-}
-
 static netdev_tx_t xlr_net_start_xmit(struct sk_buff *skb,
 				      struct net_device *ndev)
 {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 25 lines · Bhumika Goyal

The function xlr_wakeup_queue is not used anywhere in the kernel. Therefore, remove it. The static unused functions were detected using Coccinelle but the change was done by hand. Script used:

@initialize:python@
@@
def display(name,p):

	print(name,p[0].file)

@r1@
identifier func;
type T;
position p;
@@
static T func@p(...)
{
...
}

@r@
identifier r1.func;
@@
func

Quoted 5 lines

@script:python depends on !r@
func << r1.func;
p << r1.p;
@@
display(func,p)

It looks better now.

julia

Quoted 41 lines

---
Changes in v2:
* Simplify coccinelle script by removing func(...) and adding spaces around "<<"

 drivers/staging/netlogic/xlr_net.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/netlogic/xlr_net.c +0 -11
index 7db88aa..552a7dc 100644
@@ -269,16 +269,6 @@ static void xlr_make_tx_desc(struct nlm_fmn_msg *msg, unsigned long addr,
 	msg->msg3 = 0;
 }
 
-static void __maybe_unused xlr_wakeup_queue(unsigned long dev)
-{
-	struct net_device *ndev = (struct net_device *)dev;
-	struct xlr_net_priv *priv = netdev_priv(ndev);
-	struct phy_device *phydev = xlr_get_phydev(priv);
-
-	if (phydev->link)
-		netif_tx_wake_queue(netdev_get_tx_queue(ndev, priv->wakeup_q));
-}
-
 static netdev_tx_t xlr_net_start_xmit(struct sk_buff *skb,
 				      struct net_device *ndev)
 {
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1473949038-12108-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.