lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 01/18] block/rnbd: fix mixed module-builtin object
On Tue, Nov 22, 2022 at 6:18 AM Andrew Davis <afd@ti.com> wrote:
>
> On 11/19/22 5:04 PM, Alexander Lobakin wrote:
> > From: Masahiro Yamada <masahiroy@kernel.org>
> >
> > With CONFIG_BLK_DEV_RNBD_CLIENT=m and CONFIG_BLK_DEV_RNBD_SERVER=y
> > (or vice versa), rnbd-common.o is linked to a module and also to
> > vmlinux even though CFLAGS are different between builtins and modules.
> >
> > This is the same situation as fixed by commit 637a642f5ca5 ("zstd:
> > Fixing mixed module-builtin objects").
> >
> > Turn rnbd_access_mode_str() into an inline function.
> >
>
> Why inline? All you should need is "static" to keep these internal to
> each compilation unit. Inline also bloats the object files when the
> function is called from multiple places. Let the compiler decide when
> to inline.
>
> Andrew


Since it is a header file.


In header files, "static inline" should be always used.
Never "static".


If a header is included from a C file and there is a function
that is not used from that C file,
"static" would emit -Wunused-function warning
(-Wunused-function is enabled by -Wall, which is the case
for the kernel build).





--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2022-11-22 07:04    [W:0.104 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site