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]
Date:   Sat, 19 Nov 2022 23:05:48 +0000
From:   Alexander Lobakin <alobakin@...me>
To:     linux-kbuild@...r.kernel.org
Cc:     Alexander Lobakin <alobakin@...me>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Nicolas Schier <nicolas@...sle.eu>,
        Jens Axboe <axboe@...nel.dk>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Borislav Petkov <bp@...en8.de>,
        Tony Luck <tony.luck@...el.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Derek Chickles <dchickles@...vell.com>,
        Ioana Ciornei <ioana.ciornei@....com>,
        Salil Mehta <salil.mehta@...wei.com>,
        Sunil Goutham <sgoutham@...vell.com>,
        Grygorii Strashko <grygorii.strashko@...com>,
        Daniel Scally <djrscally@...il.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Brown <broonie@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        NXP Linux Team <linux-imx@....com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 05/18] mfd: rsmu: fix mixed module-builtin object

From: Masahiro Yamada <masahiroy@...nel.org>

With CONFIG_MFD_RSMU_I2C=m and CONFIG_MFD_RSMU_SPI=y (or vice versa),
rsmu_core.o is linked to a module and also to vmlinux even though the
expected CFLAGS are different between builtins and modules.

This is the same situation as fixed by commit 637a642f5ca5 ("zstd:
Fixing mixed module-builtin objects").

Split rsmu-core into a separate module.

Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Reviewed-and-tested-by: Alexander Lobakin <alobakin@...me>
Signed-off-by: Alexander Lobakin <alobakin@...me>
---
 drivers/mfd/Kconfig     | 8 ++++++--
 drivers/mfd/Makefile    | 6 ++++--
 drivers/mfd/rsmu_core.c | 3 +++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 8b93856de432..f52efa1a968d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2232,10 +2232,14 @@ config MFD_INTEL_M10_BMC
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.

+config MFD_RSMU_CORE
+	tristate
+	select MFD_CORE
+
 config MFD_RSMU_I2C
 	tristate "Renesas Synchronization Management Unit with I2C"
 	depends on I2C && OF
-	select MFD_CORE
+	select MFD_RSMU_CORE
 	select REGMAP_I2C
 	help
 	  Support for the Renesas Synchronization Management Unit, such as
@@ -2249,7 +2253,7 @@ config MFD_RSMU_I2C
 config MFD_RSMU_SPI
 	tristate "Renesas Synchronization Management Unit with SPI"
 	depends on SPI && OF
-	select MFD_CORE
+	select MFD_RSMU_CORE
 	select REGMAP_SPI
 	help
 	  Support for the Renesas Synchronization Management Unit, such as
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 7ed3ef4a698c..d40d6619bacd 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -276,7 +276,9 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC)   += intel-m10-bmc.o
 obj-$(CONFIG_MFD_ATC260X)	+= atc260x-core.o
 obj-$(CONFIG_MFD_ATC260X_I2C)	+= atc260x-i2c.o

-rsmu-i2c-objs			:= rsmu_core.o rsmu_i2c.o
-rsmu-spi-objs			:= rsmu_core.o rsmu_spi.o
+rsmu-core-objs			:= rsmu_core.o
+rsmu-i2c-objs			:= rsmu_i2c.o
+rsmu-spi-objs			:= rsmu_spi.o
+obj-$(CONFIG_MFD_RSMU_CORE)	+= rsmu-core.o
 obj-$(CONFIG_MFD_RSMU_I2C)	+= rsmu-i2c.o
 obj-$(CONFIG_MFD_RSMU_SPI)	+= rsmu-spi.o
diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu_core.c
index 29437fd0bd5b..5bf1e23a47e5 100644
--- a/drivers/mfd/rsmu_core.c
+++ b/drivers/mfd/rsmu_core.c
@@ -5,6 +5,7 @@
  * Copyright (C) 2021 Integrated Device Technology, Inc., a Renesas Company.
  */

+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mfd/core.h>
@@ -78,11 +79,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu)

 	return ret;
 }
+EXPORT_SYMBOL_GPL(rsmu_core_init);

 void rsmu_core_exit(struct rsmu_ddata *rsmu)
 {
 	mutex_destroy(&rsmu->lock);
 }
+EXPORT_SYMBOL_GPL(rsmu_core_exit);

 MODULE_DESCRIPTION("Renesas SMU core driver");
 MODULE_LICENSE("GPL");
--
2.38.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ