Re: [PATCH] sh: exports for delay.h

Geert Uytterhoeven <[email protected]>
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel.cross-arch
Message-ID <CAMuHMdULCsM_ab-Wx8emtiW9_9zFmQ4KtGeNf0-QVWjjxX8SRA@mail.gmail.com>
Hi Al,

On Fri, Dec 27, 2024 at 5:22 PM Al Viro <[email protected]> wrote:
> On Fri, Dec 27, 2024 at 04:58:58PM +0100, Geert Uytterhoeven wrote:
> > Please do not export __delay, as it is an internal implementation detail.
> > Drivers should not call __delay() directly, as it has non-standardized
> > semantics, or may not even exist.
>
> As the matter of fact, it *does* exist and is either exported or a static
> inline with everything used by it exported - on every architecture except sh.

OK, it does exist, because init/calibrate.c needs it. But that should
be the sole user outside architecture-specific code.

Unlike some other architectures, SH does not emit calls to __delay()
from various (static inline) *delay() functions.  Hence there is no
need to export it to modules. Heck, the only reason it cannot be made
static is because init/calibrate.c needs it.

Unfortunately there are still a few drivers that call __delay()
directly (usually with hardcoded constants, how portable, and
cpufreq-unfriendly), which causes people to try once in a while to
"fix the build" by re-adding the export on SH :-(

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.