bareudp: Remove unused code from header file
Subsystems (2)
cover bareudp: Remove unused code from header file
Stop exporting unused functions and structures in bareudp.h. The only piece of bareudp.h that is actually used is netif_is_bareudp(). The rest can be moved to bareudp.c or even dropped entirely.
Guillaume Nault (2):
bareudp: Remove bareudp_dev_create()
bareudp: Move definition of struct bareudp_conf to bareudp.c
drivers/net/bareudp.c | 41 +++++++---------------------------------- include/net/bareudp.h | 13 +------------ 2 files changed, 8 insertions(+), 46 deletions(-)
Signature · 1 line
2.21.3
PATCH 1/2 bareudp: Remove bareudp_dev_create()
There's no user for this function.
--- drivers/net/bareudp.c | 34 ---------------------------------- include/net/bareudp.h | 4 ---- 2 files changed, 38 deletions(-)
drivers/net/bareudp.c +0 -34
@@ -721,40 +721,6 @@ static struct rtnl_link_ops bareudp_link_ops __read_mostly = { .fill_info = bareudp_fill_info, }; -struct net_device *bareudp_dev_create (struct net *net,const char *name, -u8 name_assign_type, -struct bareudp_conf *conf) -{ -struct nlattr *tb[IFLA_MAX +1 ]; -struct net_device *dev; -int err; - -memset (tb,0 ,sizeof (tb)); - dev =rtnl_create_link (net, name, name_assign_type, - &bareudp_link_ops, tb,NULL ); -if (IS_ERR (dev)) -return dev; - - err =bareudp_configure (net, dev, conf); -if (err) { -free_netdev (dev); -return ERR_PTR (err); - } - err =dev_set_mtu (dev,IP_MAX_MTU -BAREUDP_BASE_HLEN ); -if (err) - goto err; - - err =rtnl_configure_link (dev,NULL ); -if (err <0 ) - goto err; - -return dev; -err: -bareudp_dellink (dev,NULL ); -return ERR_PTR (err); -} -EXPORT_SYMBOL_GPL (bareudp_dev_create); -static __net_init int bareudp_init_net (struct net *net) {struct bareudp_net *bn =net_generic (net, bareudp_net_id);
include/net/bareudp.h +0 -4
@@ -14,10 +14,6 @@ struct bareudp_conf {bool multi_proto_mode; }; -struct net_device *bareudp_dev_create (struct net *net,const char *name, -u8 name_assign_type, -struct bareudp_conf *info); -static inline bool netif_is_bareudp (const struct net_device *dev) { return dev->rtnl_link_ops &&
Signature · 1 line
2.21.3
PATCH 2/2 bareudp: Move definition of struct bareudp_conf to bareudp.c
In reply to Guillaume NaultThis structure is used only in bareudp.c.
While there, adjust include files: we need netdevice.h, not skbuff.h.
--- drivers/net/bareudp.c | 7 +++++++ include/net/bareudp.h | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/bareudp.c +7 -0
@@ -38,6 +38,13 @@ struct bareudp_net {struct list_head bareudp_list; }; +struct bareudp_conf { +__be16 ethertype; +__be16 port; +u16 sport_min; +bool multi_proto_mode; +}; +/* Pseudo network device */ struct bareudp_dev {struct net *net;/* netns for packet i/o */
include/net/bareudp.h +1 -8
@@ -3,17 +3,10 @@#ifndef __NET_BAREUDP_H#define __NET_BAREUDP_H +#include <linux/netdevice.h> #include <linux/types.h> -#include <linux/skbuff.h> #include <net/rtnetlink.h> -struct bareudp_conf { -__be16 ethertype; -__be16 port; -u16 sport_min; -bool multi_proto_mode; -}; -static inline bool netif_is_bareudp (const struct net_device *dev) { return dev->rtnl_link_ops &&
Signature · 1 line
2.21.3
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 10 lines · On Fri, 10 Dec 2021 20:56:33 +0100 you wrote:
Stop exporting unused functions and structures in
bareudp.h. The only piece ofbareudp.hthat is actually used isnetif_is_bareudp(). The rest can be moved tobareudp.cor even dropped entirely.Guillaume Nault (2):
bareudp: Removebareudp_dev_create()
bareudp: Move definition of structbareudp_conftobareudp.c[...]
Here is the summary with links:
- [net-next,1/2] bareudp: Remove bareudp_dev_create()
https://git.kernel.org/netdev/net-next/c/614b7a1f28f4 - [net-next,2/2] bareudp: Move definition of struct bareudp_conf to bareudp.c https://git.kernel.org/netdev/net-next/c/dcdd77ee55a7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html