All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lz4: make LZ4HC_setExternalDict as non-static
@ 2019-09-06 15:36 Arnd Bergmann
  2019-09-06 16:21 ` Denis Efremov
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2019-09-06 15:36 UTC (permalink / raw)
  Cc: Arnd Bergmann, Emil Velikov, Denis Efremov, Masahiro Yamada,
	linux-kernel

kbuild warns for exported static symbols. This one seems to
be meant as an external API but does not have any in-kernel
users:

WARNING: "LZ4HC_setExternalDict" [vmlinux] is a static EXPORT_SYMBOL

I suppose the function should not just get removed since it would
be nice to stay close to the upstream version of lz4hc, so just
make it global.

The modpost commit is correct, but is listed here as the one
that introduced the warning.

Fixes: 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 lib/lz4/lz4hc_compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c
index 176f03b83e56..e1075293c009 100644
--- a/lib/lz4/lz4hc_compress.c
+++ b/lib/lz4/lz4hc_compress.c
@@ -642,7 +642,7 @@ EXPORT_SYMBOL(LZ4_loadDictHC);
 
 /* compression */
 
-static void LZ4HC_setExternalDict(
+void LZ4HC_setExternalDict(
 	LZ4HC_CCtx_internal *ctxPtr,
 	const BYTE *newBlock)
 {
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] lz4: make LZ4HC_setExternalDict as non-static
  2019-09-06 15:36 [PATCH] lz4: make LZ4HC_setExternalDict as non-static Arnd Bergmann
@ 2019-09-06 16:21 ` Denis Efremov
  2019-09-06 18:43   ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Efremov @ 2019-09-06 16:21 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Emil Velikov, Masahiro Yamada, linux-kernel

Hi,

> kbuild warns for exported static symbols. This one seems to
> be meant as an external API but does not have any in-kernel
> users:
> 
> WARNING: "LZ4HC_setExternalDict" [vmlinux] is a static EXPORT_SYMBOL
> 
> I suppose the function should not just get removed since it would
> be nice to stay close to the upstream version of lz4hc, so just
> make it global.

I'm not sure what is better here. But just in case, I sent a different
patch that removes EXPORT_SYMBOL from this function some time ago:
https://lkml.org/lkml/2019/7/8/842

I checked first that this functions is indeed static in the original lib[1]
and this symbol is not used in kernel.

[1] https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054

Thanks,
Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lz4: make LZ4HC_setExternalDict as non-static
  2019-09-06 16:21 ` Denis Efremov
@ 2019-09-06 18:43   ` Arnd Bergmann
  2019-09-07  2:14     ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2019-09-06 18:43 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Emil Velikov, Masahiro Yamada, linux-kernel

On Fri, Sep 6, 2019 at 6:21 PM Denis Efremov <efremov@linux.com> wrote:
>
> Hi,
>
> > kbuild warns for exported static symbols. This one seems to
> > be meant as an external API but does not have any in-kernel
> > users:
> >
> > WARNING: "LZ4HC_setExternalDict" [vmlinux] is a static EXPORT_SYMBOL
> >
> > I suppose the function should not just get removed since it would
> > be nice to stay close to the upstream version of lz4hc, so just
> > make it global.
>
> I'm not sure what is better here. But just in case, I sent a different
> patch that removes EXPORT_SYMBOL from this function some time ago:
> https://lkml.org/lkml/2019/7/8/842
>
> I checked first that this functions is indeed static in the original lib[1]
> and this symbol is not used in kernel.
>
> [1] https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054

Ah, good. Your patch is the better fix then.

      Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lz4: make LZ4HC_setExternalDict as non-static
  2019-09-06 18:43   ` Arnd Bergmann
@ 2019-09-07  2:14     ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-09-07  2:14 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Denis Efremov, Emil Velikov, linux-kernel

On Sat, Sep 7, 2019 at 3:43 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Sep 6, 2019 at 6:21 PM Denis Efremov <efremov@linux.com> wrote:
> >
> > Hi,
> >
> > > kbuild warns for exported static symbols. This one seems to
> > > be meant as an external API but does not have any in-kernel
> > > users:
> > >
> > > WARNING: "LZ4HC_setExternalDict" [vmlinux] is a static EXPORT_SYMBOL
> > >
> > > I suppose the function should not just get removed since it would
> > > be nice to stay close to the upstream version of lz4hc, so just
> > > make it global.

When you make the symbol global, you need to
provide a prototype declaration in a global header.
(include/linux/lz4.h in this case)

Otherwise, nobody cannot call this function anyway.

I prefer Denis's fix-up.




> > I'm not sure what is better here. But just in case, I sent a different
> > patch that removes EXPORT_SYMBOL from this function some time ago:
> > https://lkml.org/lkml/2019/7/8/842
> >
> > I checked first that this functions is indeed static in the original lib[1]
> > and this symbol is not used in kernel.
> >
> > [1] https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054
>
> Ah, good. Your patch is the better fix then.
>
>       Arnd



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-07  2:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 15:36 [PATCH] lz4: make LZ4HC_setExternalDict as non-static Arnd Bergmann
2019-09-06 16:21 ` Denis Efremov
2019-09-06 18:43   ` Arnd Bergmann
2019-09-07  2:14     ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.