mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Steve Wahl <steve.wahl@hpe.com>,
	Colin Ian King <colin.i.king@googlemail.com>
Cc: Mike Travis <mike.travis@hpe.com>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Russ Anderson <russ.anderson@hpe.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/platform/uv: make const pointer dots a static const array
Date: Tue, 30 Nov 2021 16:26:39 -0800	[thread overview]
Message-ID: <c5a827c2b690aeadf7d633c29edaf4db23d94fdb.camel@perches.com> (raw)
In-Reply-To: <YaZ8vtajDKUVDCne@swahl-home.5wahls.com>

On Tue, 2021-11-30 at 13:34 -0600, Steve Wahl wrote:
> On Sat, Nov 27, 2021 at 05:03:20PM +0000, Colin Ian King wrote:
> > Don't populate the const array dots on the stack
[]
> Examination of the disassembly shows that the compiler actually
> eliminates the creation of the pointer "dots" on the stack and just
> passes the address of the string constant to the printk function.
> 
> So this change should not have any actual effect (I don't know where
> you got the "shrinks object code" from), and in my humble opinion
> makes the code less clear.

Probably shrinks an allmodconfig where the symbols are referenced.
It probably doesn't do anything to a defconfig.

> As such, unless there's something here I don't understand, I vote to
> reject this patch.
[]
> > but make it static
> > const and make the pointer an array to remove a dereference. Shrinks
> > object code a few bytes too.
[]
> > diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
[]
> > @@ -725,7 +725,7 @@ static void uv_nmi_dump_cpu_ip(int cpu, struct pt_regs *regs)
> >   */
> >  static void uv_nmi_dump_state_cpu(int cpu, struct pt_regs *regs)
> >  {
> > -	const char *dots = " ................................. ";
> > +	static const char dots[] = " ................................. ";



  reply	other threads:[~2021-12-01  0:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 17:03 Colin Ian King
2021-11-30 19:34 ` Steve Wahl
2021-12-01  0:26   ` Joe Perches [this message]
2021-12-01 21:39     ` Steve Wahl
2021-12-02  9:10       ` Hans de Goede
2021-12-02  9:21         ` Colin King (gmail)

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=c5a827c2b690aeadf7d633c29edaf4db23d94fdb.camel@perches.com \
    --to=joe@perches.com \
    --cc=andy@infradead.org \
    --cc=bp@alien8.de \
    --cc=colin.i.king@googlemail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dimitri.sivanich@hpe.com \
    --cc=dvhart@infradead.org \
    --cc=hpa@zytor.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.travis@hpe.com \
    --cc=mingo@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=russ.anderson@hpe.com \
    --cc=steve.wahl@hpe.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

all inboxes | Powered by JetHome®