public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Jan Beulich <JBeulich@suse.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/ucode: replace redundant string literals
Date: Tue, 22 Dec 2015 18:07:14 +0100	[thread overview]
Message-ID: <20151222170714.GD3961@pd.tnic> (raw)
In-Reply-To: <56797D0B02000078000C24EC@prv-mh.provo.novell.com>

On Tue, Dec 22, 2015 at 08:40:43AM -0700, Jan Beulich wrote:
> This doesn't just eliminate needless redundancy
> (plus avoid a possible disconnect if one string instance gets changed
> without the other(s)),

This argument is bogus. We will never ever change a user-visible command
line option. Ever.

> but also eliminates a warning some gcc versions emit ("array access
> beyond array bounds", observed with 4.3.4) in the 32-bit case.

Now that I'm interested in - how exactly do you trigger this? gcc
version, etc?

> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
>  arch/x86/kernel/cpu/microcode/core.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> --- 4.4-rc6/arch/x86/kernel/cpu/microcode/core.c
> +++ 4.4-rc6-x86-ucode-early-string/arch/x86/kernel/cpu/microcode/core.c
> @@ -83,13 +83,11 @@ static bool __init check_loader_disabled
>  {
>  #ifdef CONFIG_X86_32
>  	const char *cmdline = (const char *)__pa_nodebug(boot_command_line);
> -	const char *opt	    = "dis_ucode_ldr";
> -	const char *option  = (const char *)__pa_nodebug(opt);
> +	const char *option  = (const char *)__pa_nodebug(__setup_str_disable_loader);
>  	bool *res = (bool *)__pa_nodebug(&dis_ucode_ldr);
> -
>  #else /* CONFIG_X86_64 */
>  	const char *cmdline = boot_command_line;
> -	const char *option  = "dis_ucode_ldr";
> +	const char *option  = __setup_str_disable_loader;
>  	bool *res = &dis_ucode_ldr;
>  #endif

I don't like it: it is not clear at a glance that this __setup_str*
magic gets generated from the __setup macro. In addition, this code is
as unreadable as it is now - your patch makes it even more cryptic.

I much prefer the redundancy.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  reply	other threads:[~2015-12-22 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 15:40 [PATCH] x86/ucode: replace redundant string literals Jan Beulich
2015-12-22 17:07 ` Borislav Petkov [this message]
2015-12-22 17:20   ` Jan Beulich
2015-12-22 18:14     ` Borislav Petkov
2015-12-23 10:06       ` Jan Beulich
2015-12-23 10:10         ` Borislav Petkov
2015-12-23 10:11           ` Jan Beulich
2016-01-05 20:44             ` [PATCH] x86/microcode: Remove redundant __setup() param parsing Borislav Petkov

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=20151222170714.GD3961@pd.tnic \
    --to=bp@suse.de \
    --cc=JBeulich@suse.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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