From 0843b7db36af3e30c97fd8be8173debe9f5510b7 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Wed, 8 Apr 2020 13:31:04 +0200 Subject: [PATCH] zipl/stage3: use `command_line` variable whenever possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `command_line` variable whenever possible, this makes the code easier to read. Reviewed-by: Jan Höppner Reviewed-by: Philipp Rudo Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- zipl/boot/stage3.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zipl/boot/stage3.c b/zipl/boot/stage3.c index 018dacb4..e8ce9b71 100644 --- a/zipl/boot/stage3.c +++ b/zipl/boot/stage3.c @@ -168,11 +168,11 @@ void start(void) /* if valid command line is given, copy it into new kernel space */ if (_stage3_parms.parm_addr != UNSPECIFIED_ADDRESS) { - memcpy((void *)COMMAND_LINE, + memcpy(command_line, (void *)(unsigned long *)_stage3_parms.parm_addr, COMMAND_LINE_SIZE); /* terminate \0 */ - *(char *)(COMMAND_LINE + COMMAND_LINE_SIZE - 1) = 0; + command_line[COMMAND_LINE_SIZE - 1] = 0; } /* convert extra parameter to ascii */ @@ -199,8 +199,7 @@ void start(void) * else append */ if (cextra[begin] == 0x3d) { - memcpy((void *)COMMAND_LINE, (void *)(cextra + begin), - length); + memcpy(command_line, (void *)(cextra + begin), length); } else { /* check if length is within max value */ length = (end + 1 + length <= COMMAND_LINE_SIZE) ? length :