net: dsa: move headers exported by switch.c to switch.h
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 21 Nov 2022 13:55:48 +0000 (15:55 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Nov 2022 04:41:51 +0000 (20:41 -0800)
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@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/dsa2.c
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/switch.c
net/dsa/switch.h [new file with mode: 0644]
net/dsa/tag_8021q.c

index 5373edf45a62fb49dbee9ba83bef3f62d8f6278d..7c6b689267d07fe0203906767b9a8a053db17348 100644 (file)
@@ -22,6 +22,7 @@
 #include "master.h"
 #include "port.h"
 #include "slave.h"
+#include "switch.h"
 #include "tag.h"
 
 static DEFINE_MUTEX(dsa2_mutex);
index eee2c9729e320cac5d7735ecfdf36d47b79870df..4f21228c6f523c772ce0cbd675bf32eeb04da8bb 100644 (file)
@@ -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 &&
index 56728242f07914a9d1da53764335652db4ee188d..bf2c982150212f3c4cb7f8d37441c9e718cb72b9 100644 (file)
@@ -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
index d0d5a1c7e6f69b7d3e0959060ceb364b9407394b..6a1c84c5ec8b3df9aa807c6e838a04efd4c2150c 100644 (file)
@@ -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 (file)
index 0000000..b831b6f
--- /dev/null
@@ -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
index ee5dd1a54b515936d3c09d411ba95f7daf55c8f0..abd994dc76d5be6ece51e1a344c7a4ba8ee4b53e 100644 (file)
@@ -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