From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775Ab1JMUwj (ORCPT ); Thu, 13 Oct 2011 16:52:39 -0400 Received: from smtp-1.sys.kth.se ([130.237.32.175]:44424 "EHLO smtp-1.sys.kth.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899Ab1JMUwi (ORCPT ); Thu, 13 Oct 2011 16:52:38 -0400 X-KTH-Auth: niso [89.253.77.162] X-KTH-mail-from: niso@kth.se From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: mchehab@redhat.com Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCHv2] i7core_edac: fix erroneous size of static array Date: Thu, 13 Oct 2011 22:52:31 +0200 Message-Id: <1318539151-1096-1-git-send-email-niso@kth.se> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1318530294-6829-1-git-send-email-niso@kth.se> References: <1318530294-6829-1-git-send-email-niso@kth.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove size form lookup arrays and mark them as const. Signed-off-by: Niklas Söderlund --- 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]; -- 1.7.7