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: <20190625233942.1946-2-olteanv@gmail.com>
Date:   Wed, 26 Jun 2019 02:39:33 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     f.fainelli@...il.com, vivien.didelot@...il.com, andrew@...n.ch,
        davem@...emloft.net
Cc:     netdev@...r.kernel.org, Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH net-next 01/10] net: dsa: sja1105: Build PTP support in main DSA driver

As Arnd Bergmann pointed out in commit 78fe8a28fb96 ("net: dsa: sja1105:
fix ptp link error"), there is no point in having PTP support as a
separate loadable kernel module.

So remove the exported symbols and make sja1105.ko contain PTP support
or not based on CONFIG_NET_DSA_SJA1105_PTP.

Signed-off-by: Vladimir Oltean <olteanv@...il.com>
---
 drivers/net/dsa/sja1105/Makefile                |  2 +-
 drivers/net/dsa/sja1105/sja1105_ptp.c           | 12 ------------
 drivers/net/dsa/sja1105/sja1105_spi.c           |  2 --
 drivers/net/dsa/sja1105/sja1105_static_config.c |  3 ---
 4 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/net/dsa/sja1105/Makefile b/drivers/net/dsa/sja1105/Makefile
index 9a22f68b39e9..4483113e6259 100644
--- a/drivers/net/dsa/sja1105/Makefile
+++ b/drivers/net/dsa/sja1105/Makefile
@@ -10,5 +10,5 @@ sja1105-objs := \
     sja1105_dynamic_config.o \
 
 ifdef CONFIG_NET_DSA_SJA1105_PTP
-obj-$(CONFIG_NET_DSA_SJA1105) += sja1105_ptp.o
+sja1105-objs += sja1105_ptp.o
 endif
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c
index 3041cf9d5856..c7ce1edd8471 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.c
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.c
@@ -77,7 +77,6 @@ int sja1105_get_ts_info(struct dsa_switch *ds, int port,
 	info->phc_index = ptp_clock_index(priv->clock);
 	return 0;
 }
-EXPORT_SYMBOL_GPL(sja1105_get_ts_info);
 
 int sja1105et_ptp_cmd(const void *ctx, const void *data)
 {
@@ -95,7 +94,6 @@ int sja1105et_ptp_cmd(const void *ctx, const void *data)
 	return sja1105_spi_send_packed_buf(priv, SPI_WRITE, regs->ptp_control,
 					   buf, SJA1105_SIZE_PTP_CMD);
 }
-EXPORT_SYMBOL_GPL(sja1105et_ptp_cmd);
 
 int sja1105pqrs_ptp_cmd(const void *ctx, const void *data)
 {
@@ -113,7 +111,6 @@ int sja1105pqrs_ptp_cmd(const void *ctx, const void *data)
 	return sja1105_spi_send_packed_buf(priv, SPI_WRITE, regs->ptp_control,
 					   buf, SJA1105_SIZE_PTP_CMD);
 }
-EXPORT_SYMBOL_GPL(sja1105pqrs_ptp_cmd);
 
 /* The switch returns partial timestamps (24 bits for SJA1105 E/T, which wrap
  * around in 0.135 seconds, and 32 bits for P/Q/R/S, wrapping around in 34.35
@@ -146,7 +143,6 @@ u64 sja1105_tstamp_reconstruct(struct sja1105_private *priv, u64 now,
 
 	return ts_reconstructed;
 }
-EXPORT_SYMBOL_GPL(sja1105_tstamp_reconstruct);
 
 /* Reads the SPI interface for an egress timestamp generated by the switch
  * for frames sent using management routes.
@@ -219,7 +215,6 @@ int sja1105_ptpegr_ts_poll(struct sja1105_private *priv, int port, u64 *ts)
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(sja1105_ptpegr_ts_poll);
 
 int sja1105_ptp_reset(struct sja1105_private *priv)
 {
@@ -240,7 +235,6 @@ int sja1105_ptp_reset(struct sja1105_private *priv)
 
 	return rc;
 }
-EXPORT_SYMBOL_GPL(sja1105_ptp_reset);
 
 static int sja1105_ptp_gettime(struct ptp_clock_info *ptp,
 			       struct timespec64 *ts)
@@ -387,7 +381,6 @@ int sja1105_ptp_clock_register(struct sja1105_private *priv)
 
 	return sja1105_ptp_reset(priv);
 }
-EXPORT_SYMBOL_GPL(sja1105_ptp_clock_register);
 
 void sja1105_ptp_clock_unregister(struct sja1105_private *priv)
 {
@@ -397,8 +390,3 @@ void sja1105_ptp_clock_unregister(struct sja1105_private *priv)
 	ptp_clock_unregister(priv->clock);
 	priv->clock = NULL;
 }
-EXPORT_SYMBOL_GPL(sja1105_ptp_clock_unregister);
-
-MODULE_AUTHOR("Vladimir Oltean <olteanv@...il.com>");
-MODULE_DESCRIPTION("SJA1105 PHC Driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/net/dsa/sja1105/sja1105_spi.c b/drivers/net/dsa/sja1105/sja1105_spi.c
index f7e51debb930..84dc603138cf 100644
--- a/drivers/net/dsa/sja1105/sja1105_spi.c
+++ b/drivers/net/dsa/sja1105/sja1105_spi.c
@@ -100,7 +100,6 @@ int sja1105_spi_send_packed_buf(const struct sja1105_private *priv,
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(sja1105_spi_send_packed_buf);
 
 /* If @rw is:
  * - SPI_WRITE: creates and sends an SPI write message at absolute
@@ -136,7 +135,6 @@ int sja1105_spi_send_int(const struct sja1105_private *priv,
 
 	return rc;
 }
-EXPORT_SYMBOL_GPL(sja1105_spi_send_int);
 
 /* Should be used if a @packed_buf larger than SJA1105_SIZE_SPI_MSG_MAXLEN
  * must be sent/received. Splitting the buffer into chunks and assembling
diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.c b/drivers/net/dsa/sja1105/sja1105_static_config.c
index 58f273eaf1ea..242f001c59fe 100644
--- a/drivers/net/dsa/sja1105/sja1105_static_config.c
+++ b/drivers/net/dsa/sja1105/sja1105_static_config.c
@@ -35,7 +35,6 @@ void sja1105_pack(void *buf, const u64 *val, int start, int end, size_t len)
 	}
 	dump_stack();
 }
-EXPORT_SYMBOL_GPL(sja1105_pack);
 
 void sja1105_unpack(const void *buf, u64 *val, int start, int end, size_t len)
 {
@@ -53,7 +52,6 @@ void sja1105_unpack(const void *buf, u64 *val, int start, int end, size_t len)
 		       start, end);
 	dump_stack();
 }
-EXPORT_SYMBOL_GPL(sja1105_unpack);
 
 void sja1105_packing(void *buf, u64 *val, int start, int end,
 		     size_t len, enum packing_op op)
@@ -76,7 +74,6 @@ void sja1105_packing(void *buf, u64 *val, int start, int end,
 	}
 	dump_stack();
 }
-EXPORT_SYMBOL_GPL(sja1105_packing);
 
 /* Little-endian Ethernet CRC32 of data packed as big-endian u32 words */
 u32 sja1105_crc32(const void *buf, size_t len)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ