Skip to contentSkip to conversation

staging: gdm72xx: drop wrapper function 'netlink_exit'

PATCH In review Eva Rachel Retuya 2 participants 2 messages Mar 2, 2016 – Mar 5, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: gdm72xx: drop wrapper function 'netlink_exit'

Remove 'netlink_exit' and place a direct call to 'netlink_kernel_release' since this is used only once. Coccinelle semantic patch used to apply the change:

@remove_prototype@
@@
-void netlink_exit(...);

@remove_def@
@@

-void netlink_exit(...)
-{
- netlink_kernel_release(...);
-}

@remove_call@
expression arg;
@@

-netlink_exit(
+netlink_kernel_release(

			arg);
---
 drivers/staging/gdm72xx/gdm_wimax.c | 2 +-
 drivers/staging/gdm72xx/netlink_k.c | 5 -----
 drivers/staging/gdm72xx/netlink_k.h | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/gdm72xx/gdm_wimax.c +1 -1
index 2ee6a39..9554a51 100644
@@ -176,7 +176,7 @@ static void gdm_wimax_event_exit(void)
 		}
 
 		spin_unlock_irqrestore(&wm_event.evt_lock, flags);
-		netlink_exit(wm_event.sock);
+		netlink_kernel_release(wm_event.sock);
 		wm_event.sock = NULL;
 	}
 }
drivers/staging/gdm72xx/netlink_k.c +0 -5
index 783770b..097fdfb 100644
@@ -108,11 +108,6 @@ struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
 	return sock;
 }
 
-void netlink_exit(struct sock *sock)
-{
-	netlink_kernel_release(sock);
-}
-
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
 {
 	static u32 seq;
drivers/staging/gdm72xx/netlink_k.h +0 -1
index 1fe7198..ca8514b 100644
@@ -19,7 +19,6 @@
 
 struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
 					       void *msg, int len));
-void netlink_exit(struct sock *sock);
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);
 
 #endif /* __GDM72XX_NETLINK_K_H__ */
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 24 lines · Eva Rachel Retuya

Remove 'netlink_exit' and place a direct call to 'netlink_kernel_release' since this is used only once. Coccinelle semantic patch used to apply the change:

@remove_prototype@
@@
-void netlink_exit(...);

@remove_def@
@@

drivers/staging/gdm72xx/netlink_k.c +0 -4
-void netlink_exit(...)
-{
- 	netlink_kernel_release(...);
-}

@remove_call@
expression arg;
@@

(quoted diff) +1 -1
-netlink_exit(
+netlink_kernel_release(
			arg);
Quoted 6 lines
---
 drivers/staging/gdm72xx/gdm_wimax.c | 2 +-
 drivers/staging/gdm72xx/netlink_k.c | 5 -----
 drivers/staging/gdm72xx/netlink_k.h | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

Doesn't apply to my tree :(