Skip to content

Commit

Permalink
doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes
Browse files Browse the repository at this point in the history
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
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20241230142357.3203913-6-u.kleine-koenig@baylibre.com
  • Loading branch information
Uwe Kleine-König authored and Jonathan Corbet committed Jan 9, 2025
1 parent 3008178 commit fcf22a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Documentation/core-api/symbol-namespaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
============================================
Expand Down

0 comments on commit fcf22a9

Please sign in to comment.