lkml.org 
[lkml]   [2012]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] i7core_edac: fix erroneous size of static array
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];


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-29 02:57    [W:1.283 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site