lkml.org 
[lkml]   [2011]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] amd64_edac: fix size decoding error on K8
On Wed, Nov 09, 2011 at 12:50:42PM -0800, Tony Luck wrote:
> On Wed, Nov 9, 2011 at 12:35 PM, Borislav Petkov <bp@amd64.org> wrote:
> > +               diff = cs_mode / 3 + (unsigned)(cs_mode > 5);
> > +
> > +               return 32 << (cs_mode - diff);
>
> Code is correct - but looks like an entry for an obfuscated C
> competition.

I know, right?! Especially casting the boolean to an unsigned int. Yuck!
But it is compact the stupid thing.

> Perhaps it deserves a comment!

Sure it does, will do.

Thanks.

--
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-11-09 22:03    [W:0.094 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site