* [PATCH] initramfs: mask my_inptr as __initdata
@ 2022-08-27 7:11 wuchi
2022-08-28 21:19 ` David Disseldorp
0 siblings, 1 reply; 2+ messages in thread
From: wuchi @ 2022-08-27 7:11 UTC (permalink / raw)
To: viro, willy, mwilck, ddiss, akpm; +Cc: linux-kernel
As my_inptr is only used in __init function unpack_to_rootfs(),
mark it as __initdata to allow it be freed after boot.
Signed-off-by: wuchi <wuchi.zero@gmail.com>
---
init/initramfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/init/initramfs.c b/init/initramfs.c
index 18229cfe8906..2f5bfb7d7652 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -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>
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] initramfs: mask my_inptr as __initdata
2022-08-27 7:11 [PATCH] initramfs: mask my_inptr as __initdata wuchi
@ 2022-08-28 21:19 ` David Disseldorp
0 siblings, 0 replies; 2+ messages in thread
From: David Disseldorp @ 2022-08-28 21:19 UTC (permalink / raw)
To: wuchi; +Cc: viro, willy, mwilck, akpm, linux-kernel
On Sat, 27 Aug 2022 15:11:16 +0800, wuchi wrote:
> As my_inptr is only used in __init function unpack_to_rootfs(),
> mark it as __initdata to allow it be freed after boot.
>
> Signed-off-by: wuchi <wuchi.zero@gmail.com>
> ---
> init/initramfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 18229cfe8906..2f5bfb7d7652 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -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>
>
Looks fine.
Reviewed-by: David Disseldorp <ddiss@suse.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-28 21:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 7:11 [PATCH] initramfs: mask my_inptr as __initdata wuchi
2022-08-28 21:19 ` David Disseldorp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).