Skip to contentSkip to conversation

openvswitch: remove unused code

PATCH In review Jiri Benc 3 participants 6 messages Oct 19, 2016 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Jiri Benc

author
#0 lore raw

v2 cover openvswitch: remove unused code

Removed unused functions and unnecessary EXPORT_SYMBOLs from openvswitch.

Jiri Benc (2):
openvswitch: remove unused functions
openvswitch: remove unnecessary EXPORT_SYMBOLs

 net/openvswitch/datapath.c     |  2 --
 net/openvswitch/vport-netdev.c |  1 -
 net/openvswitch/vport.c        | 17 -----------------
 net/openvswitch/vport.h        |  1 -
 4 files changed, 21 deletions(-)
Signature · 6 lines
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
author
#2 lore raw

PATCH v2 1/2 openvswitch: remove unused functions

In reply to a message not in the archive

ovs_vport_deferred_free is not used anywhere. It's the only caller of free_vport_rcu thus this one can be removed, too.

---
new in v2

---
 net/openvswitch/vport.c | 16 ----------------
 net/openvswitch/vport.h |  1 -
 2 files changed, 17 deletions(-)
net/openvswitch/vport.c +0 -16
index 7387418ac514..9d0a87845843 100644
@@ -465,22 +465,6 @@ int ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
 }
 EXPORT_SYMBOL_GPL(ovs_vport_receive);
 
-static void free_vport_rcu(struct rcu_head *rcu)
-{
-	struct vport *vport = container_of(rcu, struct vport, rcu);
-
-	ovs_vport_free(vport);
-}
-
-void ovs_vport_deferred_free(struct vport *vport)
-{
-	if (!vport)
-		return;
-
-	call_rcu(&vport->rcu, free_vport_rcu);
-}
-EXPORT_SYMBOL_GPL(ovs_vport_deferred_free);
-
 static unsigned int packet_length(const struct sk_buff *skb)
 {
 	unsigned int length = skb->len - ETH_HLEN;
net/openvswitch/vport.h +0 -1
index f01f28a567ad..46e5b69927c7 100644
@@ -149,7 +149,6 @@ struct vport_ops {
 struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *,
 			      const struct vport_parms *);
 void ovs_vport_free(struct vport *);
-void ovs_vport_deferred_free(struct vport *vport);
 
 #define VPORT_ALIGN 8
 
Signature · 6 lines
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
author
#5 lore raw

PATCH v2 2/2 openvswitch: remove unnecessary EXPORT_SYMBOLs

In reply to a message not in the archive

Some symbols exported to other modules are really used only by openvswitch.ko. Remove the exports.

Tested by loading all 4 openvswitch modules, nothing breaks.

---
v2: ovs_vport_deferred_free is completely removed by the first patch

---
 net/openvswitch/datapath.c     | 2 --
 net/openvswitch/vport-netdev.c | 1 -
 net/openvswitch/vport.c        | 1 -
 3 files changed, 4 deletions(-)
net/openvswitch/datapath.c +0 -2
index 4d67ea856067..194435aa1165 100644
@@ -59,7 +59,6 @@
 #include "vport-netdev.h"
 
 int ovs_net_id __read_mostly;
-EXPORT_SYMBOL_GPL(ovs_net_id);
 
 static struct genl_family dp_packet_genl_family;
 static struct genl_family dp_flow_genl_family;
@@ -131,7 +130,6 @@ int lockdep_ovsl_is_held(void)
 	else
 		return 1;
 }
-EXPORT_SYMBOL_GPL(lockdep_ovsl_is_held);
 #endif
 
 static struct vport *new_vport(const struct vport_parms *);
net/openvswitch/vport-netdev.c +0 -1
index 4e3972344aa6..e825753de1e0 100644
@@ -162,7 +162,6 @@ void ovs_netdev_detach_dev(struct vport *vport)
 				netdev_master_upper_dev_get(vport->dev));
 	dev_set_promiscuity(vport->dev, -1);
 }
-EXPORT_SYMBOL_GPL(ovs_netdev_detach_dev);
 
 static void netdev_destroy(struct vport *vport)
 {
net/openvswitch/vport.c +0 -1
index 9d0a87845843..9bb85b35a1fb 100644
@@ -463,7 +463,6 @@ int ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
 	ovs_dp_process_packet(skb, &key);
 	return 0;
 }
-EXPORT_SYMBOL_GPL(ovs_vport_receive);
 
 static unsigned int packet_length(const struct sk_buff *skb)
 {
Signature · 6 lines
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
Acked-by Pravin B Shelar
#4 lore raw

Re: [PATCH net-next v2 1/2] openvswitch: remove unused functions

In reply to a message not in the archive
Quoted 4 lines · Jiri Benc

ovs_vport_deferred_free is not used anywhere. It's the only caller of free_vport_rcu thus this one can be removed, too.

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Acked-by Pravin B Shelar
#7 lore raw

Re: [PATCH net-next v2 2/2] openvswitch: remove unnecessary EXPORT_SYMBOLs

In reply to a message not in the archive
Quoted 6 lines · Jiri Benc

Some symbols exported to other modules are really used only by openvswitch.ko. Remove the exports.

Tested by loading all 4 openvswitch modules, nothing breaks.

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev