* [PATCH v2 0/2] doc: module: Two clearifications
@ 2024-12-30 14:23 Uwe Kleine-König
2024-12-30 14:23 ` [PATCH v2 1/2] doc: module: Fix documented type of namespace Uwe Kleine-König
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2024-12-30 14:23 UTC (permalink / raw)
To: Matthias Maennich, Jonathan Corbet, Masahiro Yamada
Cc: Andy Shevchenko, linux-doc, linux-kernel
Hello,
Changes since (implicit) v1, available at
https://lore.kernel.org/linux-kernel/cover.1733305665.git.ukleinek@kernel.org:
- Use "string constant" instead of "C-string" in patch #1
- Drop #undef
- Mention that before all #include statements is a usual place for the
definition of DEFAULT_SYMBOL_NAMESPACE.
Uwe Kleine-König (2):
doc: module: Fix documented type of namespace
doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes
Documentation/core-api/symbol-namespaces.rst | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] doc: module: Fix documented type of namespace
2024-12-30 14:23 [PATCH v2 0/2] doc: module: Two clearifications Uwe Kleine-König
@ 2024-12-30 14:23 ` Uwe Kleine-König
2024-12-30 14:24 ` [PATCH v2 2/2] doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes Uwe Kleine-König
2025-01-09 19:37 ` [PATCH v2 0/2] doc: module: Two clearifications Jonathan Corbet
2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2024-12-30 14:23 UTC (permalink / raw)
To: Matthias Maennich, Jonathan Corbet, Masahiro Yamada
Cc: Andy Shevchenko, linux-doc, linux-kernel
Since commit cdd30ebb1b9f ("module: Convert symbol namespace to string
literal") the namespace has to be a string. Fix accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/6fe15069c01b31aaa68c6224bec2df9f4a449858.1733305665.git.ukleinek@kernel.org
---
Documentation/core-api/symbol-namespaces.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
index 27a9cccc792c..473d025657fd 100644
--- a/Documentation/core-api/symbol-namespaces.rst
+++ b/Documentation/core-api/symbol-namespaces.rst
@@ -41,9 +41,9 @@ entries.
In addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow
exporting of kernel symbols to the kernel symbol table, variants of these are
available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and
-EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace.
-Please note that due to macro expansion that argument needs to be a
-preprocessor symbol. E.g. to export the symbol ``usb_stor_suspend`` into the
+EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace as a
+string constant. Note that this string must not contain whitespaces.
+E.g. to export the symbol ``usb_stor_suspend`` into the
namespace ``USB_STORAGE``, use::
EXPORT_SYMBOL_NS(usb_stor_suspend, "USB_STORAGE");
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes
2024-12-30 14:23 [PATCH v2 0/2] doc: module: Two clearifications Uwe Kleine-König
2024-12-30 14:23 ` [PATCH v2 1/2] doc: module: Fix documented type of namespace Uwe Kleine-König
@ 2024-12-30 14:24 ` Uwe Kleine-König
2025-01-09 19:37 ` [PATCH v2 0/2] doc: module: Two clearifications Jonathan Corbet
2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2024-12-30 14:24 UTC (permalink / raw)
To: Matthias Maennich, Jonathan Corbet, Masahiro Yamada
Cc: Andy Shevchenko, linux-doc, linux-kernel
The definition of EXPORT_SYMBOL et al depends on
DEFAULT_SYMBOL_NAMESPACE. So DEFAULT_SYMBOL_NAMESPACE must already be
available when <linux/export.h> is parsed.
Also when defined that early there is no need for an #undef, so drop
that from the usage example.
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/linux-i2c/Z09bp9uMzwXRLXuF@smile.fi.intel.com/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/3dd7ff6fa0a636de86e091286016be8c90e03631.1733305665.git.ukleinek@kernel.org
---
Documentation/core-api/symbol-namespaces.rst | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
index 473d025657fd..06f766a6aab2 100644
--- a/Documentation/core-api/symbol-namespaces.rst
+++ b/Documentation/core-api/symbol-namespaces.rst
@@ -78,11 +78,10 @@ as this argument has preference over a default symbol namespace.
A second option to define the default namespace is directly in the compilation
unit as preprocessor statement. The above example would then read::
- #undef DEFAULT_SYMBOL_NAMESPACE
#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"
-within the corresponding compilation unit before any EXPORT_SYMBOL macro is
-used.
+within the corresponding compilation unit before the #include for
+<linux/export.h>. Typically it's placed before the first #include statement.
3. How to use Symbols exported in Namespaces
============================================
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] doc: module: Two clearifications
2024-12-30 14:23 [PATCH v2 0/2] doc: module: Two clearifications Uwe Kleine-König
2024-12-30 14:23 ` [PATCH v2 1/2] doc: module: Fix documented type of namespace Uwe Kleine-König
2024-12-30 14:24 ` [PATCH v2 2/2] doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes Uwe Kleine-König
@ 2025-01-09 19:37 ` Jonathan Corbet
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2025-01-09 19:37 UTC (permalink / raw)
To: Uwe Kleine-König, Matthias Maennich, Masahiro Yamada
Cc: Andy Shevchenko, linux-doc, linux-kernel
Uwe Kleine-König <u.kleine-koenig@baylibre.com> writes:
> Hello,
>
> Changes since (implicit) v1, available at
> https://lore.kernel.org/linux-kernel/cover.1733305665.git.ukleinek@kernel.org:
>
> - Use "string constant" instead of "C-string" in patch #1
> - Drop #undef
> - Mention that before all #include statements is a usual place for the
> definition of DEFAULT_SYMBOL_NAMESPACE.
>
> Uwe Kleine-König (2):
> doc: module: Fix documented type of namespace
> doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes
>
> Documentation/core-api/symbol-namespaces.rst | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
Applied, thanks.
jon
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-09 19:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-30 14:23 [PATCH v2 0/2] doc: module: Two clearifications Uwe Kleine-König
2024-12-30 14:23 ` [PATCH v2 1/2] doc: module: Fix documented type of namespace Uwe Kleine-König
2024-12-30 14:24 ` [PATCH v2 2/2] doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes Uwe Kleine-König
2025-01-09 19:37 ` [PATCH v2 0/2] doc: module: Two clearifications Jonathan Corbet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®