From: "Niklas Söderlund" <niso@kth.se>
To: "Niklas Söderlund" <niso@kth.se>
Cc: mchehab@redhat.com, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2] i7core_edac: fix erroneous size of static array
Date: Sun, 29 Jan 2012 02:26:19 +0100 [thread overview]
Message-ID: <4F24A03B.3030001@kth.se> (raw)
In-Reply-To: <1318539151-1096-1-git-send-email-niso@kth.se>
Hi,
Anyone have comments on this or are there no interest in this patch?
// Niklas
On 10/13/2011 10:52 PM, Niklas Söderlund wrote:
> Remove size form lookup arrays and mark them as const.
>
> Signed-off-by: Niklas Söderlund <niso@kth.se>
> ---
> drivers/edac/i7core_edac.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
> index 70ad892..f50acfb 100644
> --- a/drivers/edac/i7core_edac.c
> +++ b/drivers/edac/i7core_edac.c
> @@ -417,21 +417,21 @@ static inline int numdimms(u32 dimms)
>
> static inline int numrank(u32 rank)
> {
> - static int ranks[4] = { 1, 2, 4, -EINVAL };
> + static const int ranks[] = { 1, 2, 4, -EINVAL };
>
> return ranks[rank & 0x3];
> }
>
> static inline int numbank(u32 bank)
> {
> - static int banks[4] = { 4, 8, 16, -EINVAL };
> + static const int banks[] = { 4, 8, 16, -EINVAL };
>
> return banks[bank & 0x3];
> }
>
> static inline int numrow(u32 row)
> {
> - static int rows[8] = {
> + static const int rows[] = {
> 1 << 12, 1 << 13, 1 << 14, 1 << 15,
> 1 << 16, -EINVAL, -EINVAL, -EINVAL,
> };
> @@ -441,7 +441,7 @@ static inline int numrow(u32 row)
>
> static inline int numcol(u32 col)
> {
> - static int cols[8] = {
> + static const int cols[] = {
> 1 << 10, 1 << 11, 1 << 12, -EINVAL,
> };
> return cols[col & 0x3];
next prev parent reply other threads:[~2012-01-29 1:54 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
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 [this message]
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=4F24A03B.3030001@kth.se \
--to=niso@kth.se \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.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