linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Evgeniy Baskov <baskov@ispras.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/5] x86: Add resolve_cmdline() helper
Date: Fri, 26 Aug 2022 13:35:38 +0200	[thread overview]
Message-ID: <YwiwCgIoIPnsyanu@zn.tnic> (raw)
In-Reply-To: <7eb917aeb1fa9f044f90ec33c8bf33bb6aee62a5.1653471377.git.baskov@ispras.ru>

On Wed, May 25, 2022 at 01:10:10PM +0300, Evgeniy Baskov wrote:
> Command line needs to be combined in both compressed and uncompressed
> kernel from built-in and boot command line strings, which requires
> non-trivial logic depending on CONFIG_CMDLINE_BOOL and
> CONFIG_CMDLINE_OVERRIDE.
> 
> Add a helper function to avoid code duplication.
> 
> Signed-off-by: Evgeniy Baskov <baskov@ispras.ru>
> 

You have some weird configuration to your git send-email which doesn't
add the "---" to split the patch commit message from the diffstat.

>  create mode 100644 arch/x86/include/asm/shared/setup-cmdline.h
> 
> diff --git a/arch/x86/include/asm/shared/setup-cmdline.h b/arch/x86/include/asm/shared/setup-cmdline.h

Just cmdline.h I'd say.

> new file mode 100644
> index 000000000000..9822e5af4925
> --- /dev/null
> +++ b/arch/x86/include/asm/shared/setup-cmdline.h
> @@ -0,0 +1,38 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef _ASM_X86_SETUP_CMDLINE_H
> +#define _ASM_X86_SETUP_CMDLINE_H
> +
> +#define _SETUP
> +#include <asm/setup.h> /* For COMMAND_LINE_SIZE */
> +#undef _SETUP
> +
> +#include <linux/string.h>
> +
> +#ifdef CONFIG_CMDLINE_BOOL
> +#define COMMAND_LINE_INIT CONFIG_CMDLINE
> +#else
> +#define COMMAND_LINE_INIT ""
> +#endif
> +
> +/*
> + * command_line and boot_command_line are expected to be at most
> + * COMMAND_LINE_SIZE length. command_line needs to be initialized
> + * with COMMAND_LINE_INIT.
> + */
> +


^ Superfluous newline.

> +static inline void resolve_cmdline(char *command_line,
> +				   const char *boot_command_line)

cmdline_prepare() I'd say.

> +{
> +#ifdef CONFIG_CMDLINE_BOOL
> +	if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
> +		/* Append boot loader cmdline to builtin */
> +		strlcat(command_line, " ", COMMAND_LINE_SIZE);
> +		strlcat(command_line, boot_command_line, COMMAND_LINE_SIZE);
> +	}
> +#else
> +	strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);

So that has been switched to strscpy() in the meantime:

8a33d96bd178 ("x86/setup: Use strscpy() to replace deprecated strlcpy()")

Please redo your set ontop of latest tip/master.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2022-08-26 11:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  2:40 [PATCH] x86: Parse CONFIG_CMDLINE in compressed kernel Baskov Evgeniy
2022-05-04  8:59 ` Borislav Petkov
2022-05-04 20:40   ` baskov
2022-05-04 20:41   ` [PATCH v2 0/2] " Baskov Evgeniy
2022-05-04 20:41     ` [PATCH v2 1/2] x86: add strlcat() to " Baskov Evgeniy
2022-05-04 20:41     ` [PATCH v2 2/2] x86: Parse CONFIG_CMDLINE in " Baskov Evgeniy
2022-05-05 10:32   ` [PATCH v3 0/2] " Baskov Evgeniy
2022-05-05 10:32     ` [PATCH v3 1/2] x86: Add strlcat() to " Baskov Evgeniy
2022-05-12 11:10       ` Borislav Petkov
2022-05-25  5:18         ` baskov
2022-05-05 10:32     ` [PATCH v3 2/2] x86: Parse CONFIG_CMDLINE in " Baskov Evgeniy
2022-05-12 11:21       ` Borislav Petkov
2022-05-25  5:25         ` baskov
2022-05-25  8:22           ` Borislav Petkov
2022-05-25  9:41             ` baskov
2022-05-25 10:10     ` [PATCH v4 0/5] " Evgeniy Baskov
2022-05-25 10:10       ` [PATCH v4 1/5] x86/boot: Add strlcat() to " Evgeniy Baskov
2022-05-25 10:10       ` [PATCH v4 2/5] x86: Add resolve_cmdline() helper Evgeniy Baskov
2022-08-26 11:35         ` Borislav Petkov [this message]
2022-08-27  1:51           ` Evgeniy Baskov
2022-05-25 10:10       ` [PATCH v4 3/5] x86/setup: Use resolve_cmdline() in setup.c Evgeniy Baskov
2022-05-25 10:10       ` [PATCH v4 4/5] x86/boot: Use resolve_cmdline() in compressed kernel Evgeniy Baskov
2022-05-25 10:10       ` [PATCH v4 5/5] x86/boot: Remove no longer needed includes Evgeniy Baskov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YwiwCgIoIPnsyanu@zn.tnic \
    --to=bp@alien8.de \
    --cc=baskov@ispras.ru \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).