* [PATCH net-next 0/2] bareudp: Remove unused code from header file
@ 2021-12-10 19:56 Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 1/2] bareudp: Remove bareudp_dev_create() Guillaume Nault
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Guillaume Nault @ 2021-12-10 19:56 UTC (permalink / raw)
To: David Miller, Jakub Kicinski; +Cc: netdev, Martin Varghese
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(-)
--
2.21.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] bareudp: Remove bareudp_dev_create()
2021-12-10 19:56 [PATCH net-next 0/2] bareudp: Remove unused code from header file Guillaume Nault
@ 2021-12-10 19:56 ` Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 2/2] bareudp: Move definition of struct bareudp_conf to bareudp.c Guillaume Nault
2021-12-13 12:50 ` [PATCH net-next 0/2] bareudp: Remove unused code from header file patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Guillaume Nault @ 2021-12-10 19:56 UTC (permalink / raw)
To: David Miller, Jakub Kicinski; +Cc: netdev, Martin Varghese
There's no user for this function.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
drivers/net/bareudp.c | 34 ----------------------------------
include/net/bareudp.h | 4 ----
2 files changed, 38 deletions(-)
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index edffc3489a12..fb71a0753385 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -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);
diff --git a/include/net/bareudp.h b/include/net/bareudp.h
index dc65a0d71d9b..8f07a91e0f25 100644
--- a/include/net/bareudp.h
+++ b/include/net/bareudp.h
@@ -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 &&
--
2.21.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] bareudp: Move definition of struct bareudp_conf to bareudp.c
2021-12-10 19:56 [PATCH net-next 0/2] bareudp: Remove unused code from header file Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 1/2] bareudp: Remove bareudp_dev_create() Guillaume Nault
@ 2021-12-10 19:56 ` Guillaume Nault
2021-12-13 12:50 ` [PATCH net-next 0/2] bareudp: Remove unused code from header file patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Guillaume Nault @ 2021-12-10 19:56 UTC (permalink / raw)
To: David Miller, Jakub Kicinski; +Cc: netdev, Martin Varghese
This structure is used only in bareudp.c.
While there, adjust include files: we need netdevice.h, not skbuff.h.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
drivers/net/bareudp.c | 7 +++++++
include/net/bareudp.h | 9 +--------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index fb71a0753385..f80330361399 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -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 */
diff --git a/include/net/bareudp.h b/include/net/bareudp.h
index 8f07a91e0f25..17610c8d6361 100644
--- a/include/net/bareudp.h
+++ b/include/net/bareudp.h
@@ -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 &&
--
2.21.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] bareudp: Remove unused code from header file
2021-12-10 19:56 [PATCH net-next 0/2] bareudp: Remove unused code from header file Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 1/2] bareudp: Remove bareudp_dev_create() Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 2/2] bareudp: Move definition of struct bareudp_conf to bareudp.c Guillaume Nault
@ 2021-12-13 12:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-13 12:50 UTC (permalink / raw)
To: Guillaume Nault; +Cc: davem, kuba, netdev, martin.varghese
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 10 Dec 2021 20:56:33 +0100 you wrote:
> 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
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-13 12:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 19:56 [PATCH net-next 0/2] bareudp: Remove unused code from header file Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 1/2] bareudp: Remove bareudp_dev_create() Guillaume Nault
2021-12-10 19:56 ` [PATCH net-next 2/2] bareudp: Move definition of struct bareudp_conf to bareudp.c Guillaume Nault
2021-12-13 12:50 ` [PATCH net-next 0/2] bareudp: Remove unused code from header file patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.