[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190813181610.GC2378@kroah.com>
Date: Tue, 13 Aug 2019 20:16:10 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Matthias Maennich <maennich@...gle.com>
Cc: linux-kernel@...r.kernel.org, maco@...roid.com,
kernel-team@...roid.com, arnd@...db.de, geert@...ux-m68k.org,
hpa@...or.com, jeyu@...nel.org, joel@...lfernandes.org,
kstewart@...uxfoundation.org, linux-arch@...r.kernel.org,
linux-kbuild@...r.kernel.org, linux-m68k@...ts.linux-m68k.org,
linux-modules@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-usb@...r.kernel.org, lucas.de.marchi@...il.com,
maco@...gle.com, michal.lkml@...kovi.net, mingo@...hat.com,
oneukum@...e.com, pombredanne@...b.com, sam@...nborg.org,
sboyd@...eaurora.org, sspatil@...gle.com,
stern@...land.harvard.edu, tglx@...utronix.de,
usb-storage@...ts.one-eyed-alien.net, x86@...nel.org,
yamada.masahiro@...ionext.com,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v2 06/10] export: allow definition default namespaces in
Makefiles or sources
On Tue, Aug 13, 2019 at 01:17:03PM +0100, Matthias Maennich wrote:
> To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where
> MY_NAMESPACE will always be the namespace we are exporting to, allow
> exporting all definitions of EXPORT_SYMBOL() and friends by defining
> DEFAULT_SYMBOL_NAMESPACE.
>
> For example, 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
I thought we were trying to get away from cflags :(
>
> That is equivalent to changing all EXPORT_SYMBOL(sym) definitions to
> EXPORT_SYMBOL_NS(sym, USB_COMMON). Subsequently all symbol namespaces
> functionality will apply.
>
> Another way of making use of this feature is to define the namespace
> within source or header files similar to how TRACE_SYSTEM defines are
> used:
> #undef DEFAULT_SYMBOL_NAMESPACE
> #define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
>
> Please note that, as opposed to TRACE_SYSTEM, DEFAULT_SYMBOL_NAMESPACE
> has to be defined before including include/linux/export.h.
>
> If DEFAULT_SYMBOL_NAMESPACE is defined, a symbol can still be exported
> to another namespace by using EXPORT_SYMBOL_NS() and friends with
> explicitly specifying the namespace.
Ok, good, hopefully the cflags stuff will not be the default for people.
thanks,
greg k-h
Powered by blists - more mailing lists