summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2021-06-02 17:19:34 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-06-10 13:41:26 -0400
commit99f4f5d62338cab9dcf45735344541574daedd20 (patch)
treeba01e7fd496e6f9c07fa89d44efa37efac49e81a /init
parent0ff2bb7d42c36ee60bbf3e60993666a8e0c06a24 (diff)
downloadlinux-99f4f5d62338cab9dcf45735344541574daedd20.tar.bz2
bootconfig: Share the checksum function with tools
Move the checksum calculation function into the header for sharing it with tools/bootconfig. Link: https://lkml.kernel.org/r/162262197470.264090.16325743685807878807.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'init')
-rw-r--r--init/main.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/init/main.c b/init/main.c
index e9c42a183e33..7b150f0501e2 100644
--- a/init/main.c
+++ b/init/main.c
@@ -386,16 +386,6 @@ static char * __init xbc_make_cmdline(const char *key)
return new_cmdline;
}
-static u32 boot_config_checksum(unsigned char *p, u32 size)
-{
- u32 ret = 0;
-
- while (size--)
- ret += *p++;
-
- return ret;
-}
-
static int __init bootconfig_params(char *param, char *val,
const char *unused, void *arg)
{
@@ -439,7 +429,7 @@ static void __init setup_boot_config(void)
return;
}
- if (boot_config_checksum((unsigned char *)data, size) != csum) {
+ if (xbc_calc_checksum(data, size) != csum) {
pr_err("bootconfig checksum failed\n");
return;
}