public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Niklas Söderlund" <niso@kth.se>,
	"mchehab@redhat.com" <mchehab@redhat.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] i7core_edac: fix erroneous size of static array
Date: Thu, 13 Oct 2011 21:14:48 +0200	[thread overview]
Message-ID: <20111013191448.GD3064@aftab> (raw)
In-Reply-To: <987664A83D2D224EAE907B061CE93D5301EE87A060@orsmsx505.amr.corp.intel.com>

On Thu, Oct 13, 2011 at 03:03:20PM -0400, Luck, Tony wrote:
> > -	static int cols[8] = {
> > +	static int cols[4] = {
> 
> Why are these arrays "static"? Does that generate better code than
> dynamic initialization?

They look like lookup arrays for count of things based on bit settings
and as such they should be static because they don't ... change :). If
they were dynamic, then inlining them in every function callsite would
be not cool.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2011-10-13 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 18:24 [PATCH] i7core_edac: fix erroneous size of static array Niklas Söderlund
2011-10-13 18:56 ` Borislav Petkov
2011-10-13 19:03   ` Luck, Tony
2011-10-13 19:14     ` Borislav Petkov [this message]
2011-10-13 20:04       ` Mauro Carvalho Chehab
2011-10-13 20:03   ` Niklas Söderlund
2011-10-13 20:06     ` Mauro Carvalho Chehab
2011-10-13 20:52 ` [PATCHv2] " Niklas Söderlund
2012-01-29  1:26   ` Niklas Söderlund
2012-01-29  2:01     ` Jesper Juhl
2012-01-29 22:04       ` [PATCHv3] " Niklas Söderlund
2012-01-29 22:14         ` Jesper Juhl

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=20111013191448.GD3064@aftab \
    --to=bp@amd64.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=niso@kth.se \
    --cc=tony.luck@intel.com \
    /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