Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xz: fix comments and coding style

- Fix comments that were no longer in sync with the code below them.
- Fix language errors.
- Fix coding style.

Link: https://lkml.kernel.org/r/20240721133633.47721-5-lasse.collin@tukaani.org
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Reviewed-by: Sam James <sam@gentoo.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Jubin Zhong <zhongjubin@huawei.com>
Cc: Jules Maselbas <jmaselbas@zdiv.net>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rui Li <me@lirui.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lasse Collin and committed by
Andrew Morton
ff221153 836d13a6

+20 -16
+10 -10
lib/decompress_unxz.c
··· 102 102 #ifdef STATIC 103 103 # define XZ_PREBOOT 104 104 #else 105 - #include <linux/decompress/unxz.h> 105 + # include <linux/decompress/unxz.h> 106 106 #endif 107 107 #ifdef __KERNEL__ 108 108 # include <linux/decompress/mm.h> ··· 219 219 #endif 220 220 221 221 /* 222 - * Since we need memmove anyway, would use it as memcpy too. 222 + * Since we need memmove anyway, we could use it as memcpy too. 223 223 * Commented out for now to avoid breaking things. 224 224 */ 225 225 /* ··· 389 389 } 390 390 391 391 /* 392 - * This macro is used by architecture-specific files to decompress 392 + * This function is used by architecture-specific files to decompress 393 393 * the kernel image. 394 394 */ 395 395 #ifdef XZ_PREBOOT 396 - STATIC int INIT __decompress(unsigned char *buf, long len, 397 - long (*fill)(void*, unsigned long), 398 - long (*flush)(void*, unsigned long), 399 - unsigned char *out_buf, long olen, 400 - long *pos, 401 - void (*error)(char *x)) 396 + STATIC int INIT __decompress(unsigned char *in, long in_size, 397 + long (*fill)(void *dest, unsigned long size), 398 + long (*flush)(void *src, unsigned long size), 399 + unsigned char *out, long out_size, 400 + long *in_used, 401 + void (*error)(char *x)) 402 402 { 403 - return unxz(buf, len, fill, flush, out_buf, pos, error); 403 + return unxz(in, in_size, fill, flush, out, in_used, error); 404 404 } 405 405 #endif
+2 -1
lib/xz/Kconfig
··· 5 5 help 6 6 LZMA2 compression algorithm and BCJ filters are supported using 7 7 the .xz file format as the container. For integrity checking, 8 - CRC32 is supported. See Documentation/staging/xz.rst for more information. 8 + CRC32 is supported. See Documentation/staging/xz.rst for more 9 + information. 9 10 10 11 if XZ_DEC 11 12
+8 -5
scripts/Makefile.lib
··· 530 530 531 531 # XZ 532 532 # --------------------------------------------------------------------------- 533 - # Use xzkern to compress the kernel image and xzmisc to compress other things. 533 + # Use xzkern or xzkern_with_size to compress the kernel image and xzmisc to 534 + # compress other things. 534 535 # 535 536 # xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage 536 537 # of the kernel decompressor. A BCJ filter is used if it is available for 537 - # the target architecture. xzkern also appends uncompressed size of the data 538 - # using size_append. The .xz format has the size information available at 539 - # the end of the file too, but it's in more complex format and it's good to 540 - # avoid changing the part of the boot code that reads the uncompressed size. 538 + # the target architecture. 539 + # 540 + # xzkern_with_size also appends uncompressed size of the data using 541 + # size_append. The .xz format has the size information available at the end 542 + # of the file too, but it's in more complex format and it's good to avoid 543 + # changing the part of the boot code that reads the uncompressed size. 541 544 # Note that the bytes added by size_append will make the xz tool think that 542 545 # the file is corrupt. This is expected. 543 546 #