lkml.org 
[lkml]   [2011]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i7core_edac: fix erroneous size of static array
On Thu, Oct 13, 2011 at 02:24:54PM -0400, Niklas Söderlund wrote:
> Signed-off-by: Niklas Söderlund <niso@kth.se>
> ---
> drivers/edac/i7core_edac.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
> index 70ad892..e0f6096 100644
> --- a/drivers/edac/i7core_edac.c
> +++ b/drivers/edac/i7core_edac.c
> @@ -441,7 +441,7 @@ static inline int numrow(u32 row)
>
> static inline int numcol(u32 col)
> {
> - static int cols[8] = {
> + static int cols[4] = {
> 1 << 10, 1 << 11, 1 << 12, -EINVAL,
> };

Even better,

you could completely remove the number in the [] since the {}
initializer contains all array elements already. In this and the
remaining arrays in those small inline functions.
--
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
--
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: 2011-10-13 20:59    [from the cache]
©2003-2011 Jasper Spaans