lib/lz4: make arrays static const, reduces object code size
authorColin Ian King <[email protected]>
Tue, 3 Oct 2017 23:16:01 +0000 (16:16 -0700)
committerLinus Torvalds <[email protected]>
Wed, 4 Oct 2017 00:54:25 +0000 (17:54 -0700)
commit8cb5d7482810b7eb1bb05bf4f71bc93ce35e5896
treeee9acad7dbfc98ab7e3f7c7259555f6eb50a3edb
parent50097f74934e3ec8fb1e6f3087568b958972817d
lib/lz4: make arrays static const, reduces object code size

Don't populate the read-only arrays dec32table and dec64table on the
stack, instead make them both static const.  Makes the object code
smaller by over 10K bytes:

  Before:
     text    data     bss     dec     hex filename
    31500       0       0   31500    7b0c lib/lz4/lz4_decompress.o

  After:
     text    data     bss     dec     hex filename
    20237     176       0   20413    4fbd lib/lz4/lz4_decompress.o

(gcc version 7.2.0 x86_64)

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Colin Ian King <[email protected]>
Cc: Christophe JAILLET <[email protected]>
Cc: Sven Schmidt <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/lz4/lz4_decompress.c