]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib/lzo: add unlikely hints to overrun checks
authorDavid Sterba <dsterba@suse.com>
Thu, 7 Aug 2025 11:44:44 +0000 (13:44 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 16 Aug 2025 09:24:31 +0000 (17:24 +0800)
commitd2236198839ca57610d1f7be7c61fb8c95f2fca6
tree3f1ce9dbf2345dc052468d516c1896ad2671fa57
parent817fcdbd4ca29834014a5dadbe8e11efeb12800c
lib/lzo: add unlikely hints to overrun checks

The NEED_* macros do an implicit goto in case the safety bounds checks
fail. Add the unlikely hints as this is the error case and not a hot
path. The final assembly is slightly shorter and some jumps got
reordered according to the hints.

   text    data     bss     dec     hex filename
   2294      16       0    2310     906 pre/lzo1x_decompress_safe.o
   2277      16       0    2293     8f5 post/lzo1x_decompress_safe.o

   text    data     bss     dec     hex filename
   3444      48       0    3492     da4 pre/lzo1x_compress_safe.o
   3372      48       0    3420     d5c post/lzo1x_compress_safe.o

Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/lzo/lzo1x_compress.c
lib/lzo/lzo1x_decompress_safe.c