public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: andi.shyti@kernel.org, andriy.shevchenko@linux.intel.com,
	masahiroy@kernel.org, u.kleine-koenig@baylibre.com,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-i2c@vger.kernel.org
Subject: [PATCH] module: Allow DEFAULT_SYMBOL_NAMESPACE be set after export.h included
Date: Sat, 28 Dec 2024 18:43:28 +0000	[thread overview]
Message-ID: <20241228184328.5ced280b@dsl-u17-10> (raw)

Commit ceb8bf2ceaa77 ("module: Convert default symbol namespace to string
literal") changed DEFAULT_SYMBOL_NAMESPACE to be a string literal.
However the conditional definition of _EXPORT_SYMBOL() was left in.

Instead just default DEFAULT_SYMBOL_NAMESPACE to "" and remove the
extra _EXPORT_SYMBOL() wrapper.

This lets DEFAULT_SYMBOL_NAMESPACE be defined after export.h is included.

Fixes fd57a3325a779 ("i2c: designware: Move exports to I2C_DW namespaces")

Signed-off-by: David Laight <david.laight.linux@gmail.com>
---
 drivers/i2c/busses/i2c-designware-common.c |  1 +
 drivers/i2c/busses/i2c-designware-master.c |  1 +
 drivers/i2c/busses/i2c-designware-slave.c  |  1 +
 include/linux/export.h                     | 10 ++++------
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index 183a35038eef..be5850330c75 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -29,6 +29,7 @@
 #include <linux/types.h>
 #include <linux/units.h>
 
+#undef DEFAULT_SYMBOL_NAMESPACE
 #define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW_COMMON"
 
 #include "i2c-designware-core.h"
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index c8cbe5b1aeb1..083c5961d189 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -22,6 +22,7 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
+#undef DEFAULT_SYMBOL_NAMESPACE
 #define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW"
 
 #include "i2c-designware-core.h"
diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c
index dc2b788eac5b..72b973afb0ec 100644
--- a/drivers/i2c/busses/i2c-designware-slave.c
+++ b/drivers/i2c/busses/i2c-designware-slave.c
@@ -16,6 +16,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
+#undef DEFAULT_SYMBOL_NAMESPACE
 #define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW"
 
 #include "i2c-designware-core.h"
diff --git a/include/linux/export.h b/include/linux/export.h
index 2633df4d31e6..6cea1c3982cd 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -59,14 +59,12 @@
 
 #endif
 
-#ifdef DEFAULT_SYMBOL_NAMESPACE
-#define _EXPORT_SYMBOL(sym, license)	__EXPORT_SYMBOL(sym, license, DEFAULT_SYMBOL_NAMESPACE)
-#else
-#define _EXPORT_SYMBOL(sym, license)	__EXPORT_SYMBOL(sym, license, "")
+#ifndef DEFAULT_SYMBOL_NAMESPACE
+#define DEFAULT_SYMBOL_NAMESPACE ""
 #endif
 
-#define EXPORT_SYMBOL(sym)		_EXPORT_SYMBOL(sym, "")
-#define EXPORT_SYMBOL_GPL(sym)		_EXPORT_SYMBOL(sym, "GPL")
+#define EXPORT_SYMBOL(sym)		__EXPORT_SYMBOL(sym, "", DEFAULT_SYMBOL_NAMESPACE)
+#define EXPORT_SYMBOL_GPL(sym)		__EXPORT_SYMBOL(sym, "GPL", DEFAULT_SYMBOL_NAMESPACE)
 #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", ns)
 #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "GPL", ns)
 
-- 
2.17.1


             reply	other threads:[~2024-12-28 18:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-28 18:43 David Laight [this message]
2024-12-28 21:38 ` [PATCH] module: Allow DEFAULT_SYMBOL_NAMESPACE be set after export.h included Andy Shevchenko
2024-12-29  8:25   ` David Laight
2024-12-28 23:29 ` Linus Torvalds
2024-12-29  0:59   ` David Laight
2024-12-30  9:42     ` Uwe Kleine-König
2024-12-30 12:03       ` David Laight
2024-12-30 12:54         ` Uwe Kleine-König
2024-12-30 13:42           ` David Laight
2024-12-30 11:06     ` Masahiro Yamada
2024-12-29  0:45 ` kernel test robot
2024-12-29  3:32 ` kernel test robot
2024-12-30 10:49 ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241228184328.5ced280b@dsl-u17-10 \
    --to=david.laight.linux@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox