lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1201290300100.20079@swampdragon.chaosbits.net>
Date:	Sun, 29 Jan 2012 03:01:27 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	Niklas Söderlund <niso@....se>
cc:	mchehab@...hat.com, linux-edac@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2] i7core_edac: fix erroneous size of static array

On Sun, 29 Jan 2012, Niklas Söderlund wrote:

> 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.
> > 

Besides the spelling mistake - s/form/from/ - here, it looks good to me 
:-)


> > Signed-off-by: Niklas Söderlund <niso@....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];
> 

-- 
Jesper Juhl <jj@...osbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ