Skip to content

Commit

Permalink
lib/zlib_inflate/inffast: Check config in C to avoid unused function …
Browse files Browse the repository at this point in the history
…warning

Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1
shows the warning below.

    arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function]
    get_unaligned16(const unsigned short *p)
    ^
    1 warning generated.

Fix it, by moving the check from the preprocessor to C, so the compiler
sees the use.

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
  • Loading branch information
paulmenzel authored and intel-lab-lkp committed Sep 16, 2021
1 parent ff1ffd7 commit 127eebd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/zlib_inflate/inffast.c
Expand Up @@ -254,11 +254,7 @@ void inflate_fast(z_streamp strm, unsigned start)
sfrom = (unsigned short *)(from);
loops = len >> 1;
do
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
*sout++ = *sfrom++;
#else
*sout++ = get_unaligned16(sfrom++);
#endif
*sout++ = CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS ? *sfrom++ : get_unaligned16(sfrom++);
while (--loops);
out = (unsigned char *)sout;
from = (unsigned char *)sfrom;
Expand Down

0 comments on commit 127eebd

Please sign in to comment.