[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0uXo+CLs2emsXE=-Zr+FjxV5k7AWNdGrN0fa37gwub8w@mail.gmail.com>
Date: Wed, 21 Apr 2021 13:57:34 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Niklas Schnelle <schnelle@...ux.ibm.com>
Cc: David Laight <David.Laight@...lab.com>,
Vineet Gupta <vgupta@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"clang-built-linux@...glegroups.com"
<clang-built-linux@...glegroups.com>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"linux-snps-arc@...ts.infradead.org"
<linux-snps-arc@...ts.infradead.org>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic
warning on PCI_IOBASE
On Wed, Apr 21, 2021 at 1:50 PM Niklas Schnelle <schnelle@...ux.ibm.com> wrote:
> On Wed, 2021-04-21 at 11:24 +0000, David Laight wrote:
> >
> > I suspect that this might be better not inlined
> > when PCI_IOBASE is undefined.
> >
> > Otherwise you get quite a lot of bloat from all the
> > WARN_ONCE() calls.
>
> Hmm, I was wondering if we should rather have a large ifdef block of
> all these functions stubbed to WARN_ONCE rather than in each function.
> As I understand it this would be necessary if we want the inline gone.
> They would still be static though so we still get a copy per
> compilation unit that uses it or am I misunderstanding?
I wouldn't worry too much about the size of known broken drivers during
compile testing. Also, since the functions are marked 'inline' and not
'__always_inline', the compiler is free to decide not to inline them if
the contents are excessively big, and since the strings are all identical,
they should be constant-folded.
If you want to make this a little smaller, using pr_warn_once()
would be a little smaller, but also give less information.
Arnd
Powered by blists - more mailing lists