[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi=7gHNhr0tOKQzSAhzR1TeAGQHYgh5+F1thaQkOZ094g@mail.gmail.com>
Date: Sat, 28 Dec 2024 15:29:24 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Laight <david.laight.linux@...il.com>
Cc: andi.shyti@...nel.org, andriy.shevchenko@...ux.intel.com,
masahiroy@...nel.org, u.kleine-koenig@...libre.com,
linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH] module: Allow DEFAULT_SYMBOL_NAMESPACE be set after
export.h included
On Sat, 28 Dec 2024 at 10:43, David Laight <david.laight.linux@...il.com> wrote:
>
> 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.
Grr. This is horribly ugly.
I think the i2c code should just be fixed to use the proper "define
namespace early".
I will also note that 'sparse' has a notion of a "weak define", where
you can set a default value for a preprocessor symbol, but if it gets
redefined by the user (or already has a definition), sparse won't
complain about it, and just use the strong one.
That would have been lovely, and we could have had a
#weak_define DEFAULT_SYMBOL_NAMESPACE ""
and this wouldn't be the ugly mess it is.
I wish the regular C preprocessor could do the same. Oh well. Since it
doesn't, I really think i2c should just be fixed, and we shouldn't try
to deal with i2c having done things wrong.
Linus
Powered by blists - more mailing lists