mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] loongarch: Fix broken CONFIG_CMDLINE
@ 2023-07-09  8:12 ‎ donmor
  2023-07-09  8:25 ` WANG Xuerui
       [not found] ` <6011256b-f4a9-a410-dc62-cb7a308bf07f@web.de>
  0 siblings, 2 replies; 3+ messages in thread
From: ‎ donmor @ 2023-07-09  8:12 UTC (permalink / raw)
  To: chenhuacai; +Cc: linux-kernel, loongarch, kernel

From e00182944fee67301c3ebade3147b25d9f1555aa Mon Sep 17 00:00:00 2001
From: donmor <donmor3000@hotmail.com>
Date: Sat, 8 Jul 2023 10:45:21 +0800
Subject: [PATCH] loongarch: Fix broken CONFIG_CMDLINE

This patch tends to fix CONFIG_CMDLINE, which is not working with
CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER. Some code is absent
in
arch/loongarch/kernel/setup.c, which should handle built-in command
lines
in CONFIG_CMDLINE. The absence of such code causes CONFIG_CMDLINE not
working if CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER is set to
Y.
CONFIG_CMDLINE_FORCE is not affected.

Signed-off-by: donmor <donmor3000@hotmail.com>
---
 arch/loongarch/kernel/setup.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/loongarch/kernel/setup.c
b/arch/loongarch/kernel/setup.c
index 78a00359bde3..dc6e01c340bb 100644
--- a/arch/loongarch/kernel/setup.c
+++ b/arch/loongarch/kernel/setup.c
@@ -335,6 +335,22 @@ static void __init bootcmdline_init(char
**cmdline_p)
 	}
 #endif
 
+#ifdef CONFIG_CMDLINE
+	/*
+	 * If CONFIG_CMDLINE_BOOTLOADER is enabled then we use the
built-in
+	 * command line if no command line given, or we append given
command
+	 * line to the built-in one if CONFIG_CMDLINE_EXTEND is
enabled.
+	 */
+	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND)) {
+		strscpy(boot_command_line, CONFIG_CMDLINE,
COMMAND_LINE_SIZE);
+		strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+		strlcat(boot_command_line, init_command_line,
COMMAND_LINE_SIZE);
+	}
+
+	if (IS_ENABLED(CONFIG_CMDLINE_BOOTLOADER) &&
!boot_command_line[0])
+		strscpy(boot_command_line, CONFIG_CMDLINE,
COMMAND_LINE_SIZE);
+#endif
+
 out:
 	*cmdline_p = boot_command_line;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] loongarch: Fix broken CONFIG_CMDLINE
  2023-07-09  8:12 [PATCH] loongarch: Fix broken CONFIG_CMDLINE ‎ donmor
@ 2023-07-09  8:25 ` WANG Xuerui
       [not found] ` <6011256b-f4a9-a410-dc62-cb7a308bf07f@web.de>
  1 sibling, 0 replies; 3+ messages in thread
From: WANG Xuerui @ 2023-07-09  8:25 UTC (permalink / raw)
  To: donmor, chenhuacai; +Cc: linux-kernel, loongarch

On 7/9/23 16:12, donmor wrote:
>  From e00182944fee67301c3ebade3147b25d9f1555aa Mon Sep 17 00:00:00 2001
> From: donmor <donmor3000@hotmail.com>
> Date: Sat, 8 Jul 2023 10:45:21 +0800
> Subject: [PATCH] loongarch: Fix broken CONFIG_CMDLINE
Please use git send-email to send the patch.
> [snip]
> +	 * If CONFIG_CMDLINE_BOOTLOADER is enabled then we use the
> built-in
> +	 * command line if no command line given, or we append given
> command
> +	 * line to the built-in one if CONFIG_CMDLINE_EXTEND is
> enabled.
> +	 */

Note how your mail client corrupted the diff by applying its 
line-wrapping logic for you when it really shouldn't...

-- 
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] loongarch: Fix broken CONFIG_CMDLINE (RESEND 2)
       [not found] ` <6011256b-f4a9-a410-dc62-cb7a308bf07f@web.de>
@ 2023-07-09 13:43   ` ‎ donmor
  0 siblings, 0 replies; 3+ messages in thread
From: ‎ donmor @ 2023-07-09 13:43 UTC (permalink / raw)
  To: Markus.Elfring, kernel-janitors, chenhuacai, loongarch
  Cc: linux-kernel, kernel

在 2023-07-09星期日的 14:56 +0200,Markus Elfring写道:
> > This patch tends to fix CONFIG_CMDLINE, which is not working with
> > CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER. Some code is absent
> > in
> > arch/loongarch/kernel/setup.c, which should handle built-in command
> > lines
> > in CONFIG_CMDLINE. The absence of such code causes CONFIG_CMDLINE not
> > working if CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER is set to
> > Y.
> …
> 
> Please choose an imperative change suggestion.
> 
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n94
> 
> 
> > Signed-off-by: donmor <donmor3000@hotmail.com>
> 
> Would a more unique real name be more appropriate here?
> 
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n411
> 
> Regards,
> Markus

I'll resend this patch. It may be a new conversation since the subject has been changed.
Sorry for resending twice because Outlook Web messed my mail up.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-09 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09  8:12 [PATCH] loongarch: Fix broken CONFIG_CMDLINE ‎ donmor
2023-07-09  8:25 ` WANG Xuerui
     [not found] ` <6011256b-f4a9-a410-dc62-cb7a308bf07f@web.de>
2023-07-09 13:43   ` [PATCH] loongarch: Fix broken CONFIG_CMDLINE (RESEND 2) ‎ donmor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®