linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict
@ 2019-07-08 15:15 Denis Efremov
  2019-09-10 12:13 ` Denis Efremov
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Efremov @ 2019-07-08 15:15 UTC (permalink / raw)
  To: Sven Schmidt
  Cc: Denis Efremov, Arnd Bergmann, Bongkyu Kim, Rui Salvaterra,
	Sergey Senozhatsky, Herbert Xu, David S . Miller,
	Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck, linux-kernel

The function LZ4HC_setExternalDict is declared static and marked
EXPORT_SYMBOL, which is at best an odd combination. Because the function
is not used outside of the lib/lz4/lz4hc_compress.c file it is defined in,
this commit removes the EXPORT_SYMBOL() marking.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 lib/lz4/lz4hc_compress.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c
index 176f03b83e56..1b61d874e337 100644
--- a/lib/lz4/lz4hc_compress.c
+++ b/lib/lz4/lz4hc_compress.c
@@ -663,7 +663,6 @@ static void LZ4HC_setExternalDict(
 	/* match referencing will resume from there */
 	ctxPtr->nextToUpdate = ctxPtr->dictLimit;
 }
-EXPORT_SYMBOL(LZ4HC_setExternalDict);
 
 static int LZ4_compressHC_continue_generic(
 	LZ4_streamHC_t *LZ4_streamHCPtr,
-- 
2.21.0


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

* Re: [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict
  2019-07-08 15:15 [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict Denis Efremov
@ 2019-09-10 12:13 ` Denis Efremov
  2019-09-10 12:16   ` Masahiro Yamada
  2019-09-10 12:47   ` Arnd Bergmann
  0 siblings, 2 replies; 4+ messages in thread
From: Denis Efremov @ 2019-09-10 12:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sven Schmidt, Arnd Bergmann, Bongkyu Kim, Rui Salvaterra,
	Sergey Senozhatsky, Herbert Xu, David S . Miller,
	Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck, linux-kernel,
	Masahiro Yamada

+Cc: Andrew Morton <akpm@linux-foundation.org>,
     Masahiro Yamada <yamada.masahiro@socionext.com>

Hi,

On 7/8/19 6:15 PM, Denis Efremov wrote:
> The function LZ4HC_setExternalDict is declared static and marked
> EXPORT_SYMBOL, which is at best an odd combination. Because the function
> is not used outside of the lib/lz4/lz4hc_compress.c file it is defined in,
> this commit removes the EXPORT_SYMBOL() marking.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  lib/lz4/lz4hc_compress.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c
> index 176f03b83e56..1b61d874e337 100644
> --- a/lib/lz4/lz4hc_compress.c
> +++ b/lib/lz4/lz4hc_compress.c
> @@ -663,7 +663,6 @@ static void LZ4HC_setExternalDict(
>  	/* match referencing will resume from there */
>  	ctxPtr->nextToUpdate = ctxPtr->dictLimit;
>  }
> -EXPORT_SYMBOL(LZ4HC_setExternalDict);
>  
>  static int LZ4_compressHC_continue_generic(
>  	LZ4_streamHC_t *LZ4_streamHCPtr,
> 

Andrew, could you please look at this patch and accept it if everybody agrees?
static LZ4HC_setExternalDict will trigger a warning after this check
will be in tree https://lkml.org/lkml/2019/7/14/118

There is also a different fix by Arnd Bergmann with making this function non-static:
https://lkml.org/lkml/2019/9/6/669

But since there is no uses of this EXPORT_SYMBOL in kernel and LZ4HC_setExternalDict
is indeed static in the original library https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054
we came to the conclusion that it will be better to simply unexport the symbol.

Thanks,
Denis

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

* Re: [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict
  2019-09-10 12:13 ` Denis Efremov
@ 2019-09-10 12:16   ` Masahiro Yamada
  2019-09-10 12:47   ` Arnd Bergmann
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-09-10 12:16 UTC (permalink / raw)
  To: Denis Efremov
  Cc: Andrew Morton, Sven Schmidt, Arnd Bergmann, Bongkyu Kim,
	Rui Salvaterra, Sergey Senozhatsky, Herbert Xu, David S . Miller,
	Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck,
	Linux Kernel Mailing List

On Tue, Sep 10, 2019 at 9:13 PM Denis Efremov <efremov@linux.com> wrote:
>
> +Cc: Andrew Morton <akpm@linux-foundation.org>,
>      Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Hi,
>
> On 7/8/19 6:15 PM, Denis Efremov wrote:
> > The function LZ4HC_setExternalDict is declared static and marked
> > EXPORT_SYMBOL, which is at best an odd combination. Because the function
> > is not used outside of the lib/lz4/lz4hc_compress.c file it is defined in,
> > this commit removes the EXPORT_SYMBOL() marking.
> >
> > Signed-off-by: Denis Efremov <efremov@linux.com>

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


> > ---
> >  lib/lz4/lz4hc_compress.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c
> > index 176f03b83e56..1b61d874e337 100644
> > --- a/lib/lz4/lz4hc_compress.c
> > +++ b/lib/lz4/lz4hc_compress.c
> > @@ -663,7 +663,6 @@ static void LZ4HC_setExternalDict(
> >       /* match referencing will resume from there */
> >       ctxPtr->nextToUpdate = ctxPtr->dictLimit;
> >  }
> > -EXPORT_SYMBOL(LZ4HC_setExternalDict);
> >
> >  static int LZ4_compressHC_continue_generic(
> >       LZ4_streamHC_t *LZ4_streamHCPtr,
> >
>
> Andrew, could you please look at this patch and accept it if everybody agrees?
> static LZ4HC_setExternalDict will trigger a warning after this check
> will be in tree https://lkml.org/lkml/2019/7/14/118
>
> There is also a different fix by Arnd Bergmann with making this function non-static:
> https://lkml.org/lkml/2019/9/6/669
>
> But since there is no uses of this EXPORT_SYMBOL in kernel and LZ4HC_setExternalDict
> is indeed static in the original library https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054
> we came to the conclusion that it will be better to simply unexport the symbol.
>
> Thanks,
> Denis



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict
  2019-09-10 12:13 ` Denis Efremov
  2019-09-10 12:16   ` Masahiro Yamada
@ 2019-09-10 12:47   ` Arnd Bergmann
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-09-10 12:47 UTC (permalink / raw)
  To: Denis Efremov
  Cc: Andrew Morton, Sven Schmidt, Bongkyu Kim, Rui Salvaterra,
	Sergey Senozhatsky, Herbert Xu, David S . Miller,
	Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck, linux-kernel,
	Masahiro Yamada

On Tue, Sep 10, 2019 at 2:13 PM Denis Efremov <efremov@linux.com> wrote:
>
> +Cc: Andrew Morton <akpm@linux-foundation.org>,
>      Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Hi,
>
> On 7/8/19 6:15 PM, Denis Efremov wrote:
> > The function LZ4HC_setExternalDict is declared static and marked
> > EXPORT_SYMBOL, which is at best an odd combination. Because the function
> > is not used outside of the lib/lz4/lz4hc_compress.c file it is defined in,
> > this commit removes the EXPORT_SYMBOL() marking.
> >
> > Signed-off-by: Denis Efremov <efremov@linux.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

> Andrew, could you please look at this patch and accept it if everybody agrees?
> static LZ4HC_setExternalDict will trigger a warning after this check
> will be in tree https://lkml.org/lkml/2019/7/14/118
>
> There is also a different fix by Arnd Bergmann with making this function non-static:
> https://lkml.org/lkml/2019/9/6/669
>
> But since there is no uses of this EXPORT_SYMBOL in kernel and LZ4HC_setExternalDict
> is indeed static in the original library https://github.com/lz4/lz4/blob/dev/lib/lz4hc.c#L1054
> we came to the conclusion that it will be better to simply unexport the symbol.

Right, this version is better than mine.

      Arnd

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

end of thread, other threads:[~2019-09-10 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 15:15 [PATCH] lib/lz4: remove the exporting of LZ4HC_setExternalDict Denis Efremov
2019-09-10 12:13 ` Denis Efremov
2019-09-10 12:16   ` Masahiro Yamada
2019-09-10 12:47   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).