Commit ceb8bf2c authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Torvalds
Browse files

module: Convert default symbol namespace to string literal



Commit cdd30ebb ("module: Convert symbol namespace to string
literal") only converted MODULE_IMPORT_NS() and EXPORT_SYMBOL_NS(),
leaving DEFAULT_SYMBOL_NAMESPACE as a macro expansion.

This commit converts DEFAULT_SYMBOL_NAMESPACE in the same way to avoid
annoyance for the default namespace as well.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3727b1a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ is to define the default namespace in the ``Makefile`` of the subsystem. E.g. to
export all symbols defined in usb-common into the namespace USB_COMMON, add a
line like this to drivers/usb/common/Makefile::

	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'

That will affect all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() statements. A
symbol exported with EXPORT_SYMBOL_NS() while this definition is present, will
@@ -79,7 +79,7 @@ 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
	#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"

within the corresponding compilation unit before any EXPORT_SYMBOL macro is
used.
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ Per esempio per esportare tutti i simboli definiti in usb-common nello spazio
dei nomi USB_COMMON, si può aggiungere la seguente linea in
drivers/usb/common/Makefile::

	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'

Questo cambierà tutte le macro EXPORT_SYMBOL() ed EXPORT_SYMBOL_GPL(). Invece,
un simbolo esportato con EXPORT_SYMBOL_NS() non verrà cambiato e il simbolo
@@ -79,7 +79,7 @@ Una seconda possibilità è quella di definire il simbolo di preprocessore
direttamente nei file da compilare. L'esempio precedente diventerebbe::

	#undef  DEFAULT_SYMBOL_NAMESPACE
	#define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
	#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"

Questo va messo prima di un qualsiasi uso di EXPORT_SYMBOL.

+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@
子系统的 ``Makefile`` 中定义默认命名空间。例如,如果要将usb-common中定义的所有符号导
出到USB_COMMON命名空间,可以在drivers/usb/common/Makefile中添加这样一行::

       ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
       ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'

这将影响所有 EXPORT_SYMBOL() 和 EXPORT_SYMBOL_GPL() 语句。当这个定义存在时,
用EXPORT_SYMBOL_NS()导出的符号仍然会被导出到作为命名空间参数传递的命名空间中,
@@ -76,7 +76,7 @@
成::

       #undef  DEFAULT_SYMBOL_NAMESPACE
       #define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
       #define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"

应置于相关编译单元中任何 EXPORT_SYMBOL 宏之前

+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#

ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CDX_BUS
ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"CDX_BUS"'

obj-$(CONFIG_CDX_BUS) += cdx.o controller/

+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
# Makefile for IAA crypto device drivers
#

ccflags-y += -I $(srctree)/drivers/dma/idxd -DDEFAULT_SYMBOL_NAMESPACE=IDXD
ccflags-y += -I $(srctree)/drivers/dma/idxd -DDEFAULT_SYMBOL_NAMESPACE='"IDXD"'

obj-$(CONFIG_CRYPTO_DEV_IAA_CRYPTO) := iaa_crypto.o

Loading