initramfs: mark my_inptr as __initdata
authorwuchi <wuchi.zero@gmail.com>
Sat, 27 Aug 2022 07:11:16 +0000 (15:11 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 Sep 2022 04:55:11 +0000 (21:55 -0700)
As my_inptr is only used in __init function unpack_to_rootfs(), mark it as
__initdata to allow it be freed after boot.

Link: https://lkml.kernel.org/r/20220827071116.83078-1-wuchi.zero@gmail.com
Signed-off-by: wuchi <wuchi.zero@gmail.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
init/initramfs.c

index 18229cfe8906b7632d7f3f94574c870145f565a6..2f5bfb7d765216c631759c1c37bf14ac90001982 100644 (file)
@@ -482,7 +482,7 @@ static long __init flush_buffer(void *bufv, unsigned long len)
        return origLen;
 }
 
-static unsigned long my_inptr; /* index of next byte to be processed in inbuf */
+static unsigned long my_inptr __initdata; /* index of next byte to be processed in inbuf */
 
 #include <linux/decompress/generic.h>