[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220218164420.GR614@gate.crashing.org>
Date: Fri, 18 Feb 2022 10:44:20 -0600
From: Segher Boessenkool <segher@...nel.crashing.org>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
David Laight <David.Laight@...lab.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net v3] net: Force inlining of checksum functions in net/checksum.h
On Fri, Feb 18, 2022 at 08:29:20AM -0800, Stephen Hemminger wrote:
> On Fri, 18 Feb 2022 06:12:37 -0600
> Segher Boessenkool <segher@...nel.crashing.org> wrote:
> > On Fri, Feb 18, 2022 at 10:35:48AM +0900, Masahiro Yamada wrote:
> > > On Fri, Feb 18, 2022 at 3:10 AM Segher Boessenkool
> > > <segher@...nel.crashing.org> wrote:
> > > > On Fri, Feb 18, 2022 at 02:27:16AM +0900, Masahiro Yamada wrote:
> > > > > On Fri, Feb 18, 2022 at 1:49 AM David Laight <David.Laight@...lab.com> wrote:
> > > > > > That description is largely fine.
> > > > > >
> > > > > > Inappropriate 'inline' ought to be removed.
> > > > > > Then 'inline' means - 'really do inline this'.
> > > > >
> > > > > You cannot change "static inline" to "static"
> > > > > in header files.
> > > >
> > > > Why not? Those two have identical semantics!
> > >
> > > e.g.)
> > >
> > >
> > > [1] Open include/linux/device.h with your favorite editor,
> > > then edit
> > >
> > > static inline void *devm_kcalloc(struct device *dev,
> > >
> > > to
> > >
> > > static void *devm_kcalloc(struct device *dev,
> > >
> > >
> > > [2] Build the kernel
> >
> > You get some "defined but not used" warnings that are shushed for
> > inlines. Do you see something else?
> >
> > The semantics are the same. Warnings are just warnings. It builds
> > fine.
>
> Kernel code should build with zero warnings, the compiler is telling you
> something.
The second part is of course true. The first part less so, and is in
fact not true at all from some points of view:
$ ./build --kernel x86_64
Building x86_64... (target x86_64-linux)
kernel: configure [00:06] build [02:12] 1949 warnings OK
(This is with a development version of GCC.)
There are simple ways to shut up specific warnings for specific code.
That is useful, certainly. And so is having a warning-free build. It
is obvious that we do survive without either of that though!
And none of this detracts from the point that the semantics of "static"
and "static inline" are identical.
Segher
Powered by blists - more mailing lists