[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6uhyNPbk_93lsci@smile.fi.intel.com>
Date: Tue, 11 Feb 2025 21:15:20 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mark Brown <broonie@...nel.org>
Cc: Uwe Kleine-König <ukleinek@...nel.org>,
David Lechner <dlechner@...libre.com>,
Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Nuno Sá <nuno.sa@...log.com>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>,
David Jander <david@...tonic.nl>,
Martin Sperl <kernel@...tin.sperl.org>, linux-spi@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v8 01/17] spi: add basic support for SPI offloading
On Tue, Feb 11, 2025 at 06:53:17PM +0000, Mark Brown wrote:
> On Tue, Feb 11, 2025 at 07:45:30PM +0100, Uwe Kleine-König wrote:
>
> > There was a similar discussion some time ago about the lpss pwm driver
> > (https://lore.kernel.org/linux-pwm/Z09YJGifvpENYNPy@smile.fi.intel.com/).
> > The arguments that you didn't accept back then already are similar to
> > the ones that were brought forward here.
> > The TL;DR; is: Adding MODULE_IMPORT_NS() to a header makes it easier for
> > code to use the exported symbols. Yes, that includes abusers of the
> > code.
>
> > But if you mostly care about the regular users of an API/ABI, making
> > things easy for those is the thing that matters. Agreed, if you think
> > that module namespaces are primarily a line of defence against abusers,
> > adding the import to the header weakens that defence (a bit). However a
> > typical header includes function prototypes and macros. Those also make
> > it easier for abusers. With your argumentation we better don't create
> > headers at all?
>
> > There are other benefits of module namespaces like reducing the set of
> > globally available symbols which speeds up module loading or the
> > ability to see in the module meta data that a namespace is used.
>
> FWIW I fully endorse what Uwe is saying here, forcing every user of the
> API to separately import the symbols seems more likely to create
> busywork than to avoid problems.
I see. Another problem that comes to my mind just now is the module.h to be
included by every header that wants to use MODULE_*() macro. Maybe someone
wants to split mod_namespace.h to decrease an added chaos?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists