lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221121135555.1227271-11-vladimir.oltean@nxp.com>
Date:   Mon, 21 Nov 2022 15:55:48 +0200
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     netdev@...r.kernel.org
Cc:     Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: [PATCH net-next 10/17] net: dsa: move headers exported by switch.c to switch.h

Reduce code bloat in dsa_priv.h by moving the prototypes exported by
switch.h into their own header file.

Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
 net/dsa/dsa2.c      |  1 +
 net/dsa/dsa_priv.h  |  4 ----
 net/dsa/port.c      |  1 +
 net/dsa/switch.c    |  1 +
 net/dsa/switch.h    | 11 +++++++++++
 net/dsa/tag_8021q.c |  1 +
 6 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 net/dsa/switch.h

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 5373edf45a62..7c6b689267d0 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -22,6 +22,7 @@
 #include "master.h"
 #include "port.h"
 #include "slave.h"
+#include "switch.h"
 #include "tag.h"
 
 static DEFINE_MUTEX(dsa2_mutex);
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index eee2c9729e32..4f21228c6f52 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -155,10 +155,6 @@ bool dsa_schedule_work(struct work_struct *work);
 /* netlink.c */
 extern struct rtnl_link_ops dsa_link_ops __read_mostly;
 
-/* switch.c */
-int dsa_switch_register_notifier(struct dsa_switch *ds);
-void dsa_switch_unregister_notifier(struct dsa_switch *ds);
-
 static inline bool dsa_switch_supports_uc_filtering(struct dsa_switch *ds)
 {
 	return ds->ops->port_fdb_add && ds->ops->port_fdb_del &&
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 56728242f079..bf2c98215021 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -15,6 +15,7 @@
 #include "dsa_priv.h"
 #include "port.h"
 #include "slave.h"
+#include "switch.h"
 
 /**
  * dsa_port_notify - Notify the switching fabric of changes to a port
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index d0d5a1c7e6f6..6a1c84c5ec8b 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -15,6 +15,7 @@
 #include "dsa_priv.h"
 #include "port.h"
 #include "slave.h"
+#include "switch.h"
 
 static unsigned int dsa_switch_fastest_ageing_time(struct dsa_switch *ds,
 						   unsigned int ageing_time)
diff --git a/net/dsa/switch.h b/net/dsa/switch.h
new file mode 100644
index 000000000000..b831b6fb45e9
--- /dev/null
+++ b/net/dsa/switch.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef __DSA_SWITCH_H
+#define __DSA_SWITCH_H
+
+struct dsa_switch;
+
+int dsa_switch_register_notifier(struct dsa_switch *ds);
+void dsa_switch_unregister_notifier(struct dsa_switch *ds);
+
+#endif
diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c
index ee5dd1a54b51..abd994dc76d5 100644
--- a/net/dsa/tag_8021q.c
+++ b/net/dsa/tag_8021q.c
@@ -9,6 +9,7 @@
 
 #include "dsa_priv.h"
 #include "port.h"
+#include "switch.h"
 #include "tag.h"
 
 /* Binary structure of the fake 12-bit VID field (when the TPID is
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ