Commit ff221153 authored by Lasse Collin's avatar Lasse Collin Committed by Andrew Morton

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.orgSigned-off-by: default avatarLasse Collin <lasse.collin@tukaani.org>
Reviewed-by: default avatarSam 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 836d13a6
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
#ifdef STATIC #ifdef STATIC
# define XZ_PREBOOT # define XZ_PREBOOT
#else #else
#include <linux/decompress/unxz.h> # include <linux/decompress/unxz.h>
#endif #endif
#ifdef __KERNEL__ #ifdef __KERNEL__
# include <linux/decompress/mm.h> # include <linux/decompress/mm.h>
...@@ -219,7 +219,7 @@ void *memmove(void *dest, const void *src, size_t size) ...@@ -219,7 +219,7 @@ void *memmove(void *dest, const void *src, size_t size)
#endif #endif
/* /*
* Since we need memmove anyway, would use it as memcpy too. * Since we need memmove anyway, we could use it as memcpy too.
* Commented out for now to avoid breaking things. * Commented out for now to avoid breaking things.
*/ */
/* /*
...@@ -389,17 +389,17 @@ STATIC int INIT unxz(unsigned char *in, long in_size, ...@@ -389,17 +389,17 @@ STATIC int INIT unxz(unsigned char *in, long in_size,
} }
/* /*
* This macro is used by architecture-specific files to decompress * This function is used by architecture-specific files to decompress
* the kernel image. * the kernel image.
*/ */
#ifdef XZ_PREBOOT #ifdef XZ_PREBOOT
STATIC int INIT __decompress(unsigned char *buf, long len, STATIC int INIT __decompress(unsigned char *in, long in_size,
long (*fill)(void*, unsigned long), long (*fill)(void *dest, unsigned long size),
long (*flush)(void*, unsigned long), long (*flush)(void *src, unsigned long size),
unsigned char *out_buf, long olen, unsigned char *out, long out_size,
long *pos, long *in_used,
void (*error)(char *x)) void (*error)(char *x))
{ {
return unxz(buf, len, fill, flush, out_buf, pos, error); return unxz(in, in_size, fill, flush, out, in_used, error);
} }
#endif #endif
...@@ -5,7 +5,8 @@ config XZ_DEC ...@@ -5,7 +5,8 @@ config XZ_DEC
help help
LZMA2 compression algorithm and BCJ filters are supported using LZMA2 compression algorithm and BCJ filters are supported using
the .xz file format as the container. For integrity checking, the .xz file format as the container. For integrity checking,
CRC32 is supported. See Documentation/staging/xz.rst for more information. CRC32 is supported. See Documentation/staging/xz.rst for more
information.
if XZ_DEC if XZ_DEC
......
...@@ -530,14 +530,17 @@ quiet_cmd_fit = FIT $@ ...@@ -530,14 +530,17 @@ quiet_cmd_fit = FIT $@
# XZ # XZ
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Use xzkern to compress the kernel image and xzmisc to compress other things. # Use xzkern or xzkern_with_size to compress the kernel image and xzmisc to
# compress other things.
# #
# xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage # xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage
# of the kernel decompressor. A BCJ filter is used if it is available for # of the kernel decompressor. A BCJ filter is used if it is available for
# the target architecture. xzkern also appends uncompressed size of the data # the target architecture.
# using size_append. The .xz format has the size information available at #
# the end of the file too, but it's in more complex format and it's good to # xzkern_with_size also appends uncompressed size of the data using
# avoid changing the part of the boot code that reads the uncompressed size. # size_append. The .xz format has the size information available at the end
# of the file too, but it's in more complex format and it's good to avoid
# changing the part of the boot code that reads the uncompressed size.
# Note that the bytes added by size_append will make the xz tool think that # Note that the bytes added by size_append will make the xz tool think that
# the file is corrupt. This is expected. # the file is corrupt. This is expected.
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment