From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: torvalds@linux-foundation.org, borislav.petkov@amd.com,
greg@kroah.com, tglx@linutronix.de, hpa@zytor.com,
dougthompson@xmission.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 13/21] amd64_edac: add f10-and-later methods-p3
Date: Wed, 29 Apr 2009 22:47:30 +0200 [thread overview]
Message-ID: <20090429204730.GA24298@elte.hu> (raw)
In-Reply-To: <20090429195357.GB17021@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
>
> * Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > On Wed, 29 Apr 2009 21:23:26 +0200
> > Ingo Molnar <mingo@elte.hu> wrote:
> >
> > > > > > + if (CSFound >= 0) {
> > > > > > + *node_id = NodeID;
> > > > > > + *channel_select = ChannelSelect;
> > > > > > + }
> > > > > > + }
> > > > > > +
> > > > > > + return CSFound;
> > > > > > +}
> > > > >
> > > > > this function is probably too large, and also it uses some weird
> > > > > hungarian notation coding style. Please dont do that! It's
> > > > > completely unacceptable.
> > > >
> > > > These identifers (or at least, DctSelBaseOffsetLong, which is the
> > > > only one I googled for) come straight out of the AMD "BIOS and
> > > > Kernel Developer's Guide".
> > > >
> > > > Sucky though they are, there's value in making the kernel code
> > > > match up with the documentation.
> > >
> > > I'm generally resisting patches that hungarinize arch/x86/ (and heck
> > > there's been many attempts ...) but there's some conflicting advice
> > > here. I've Cc:-ed Linus, maybe he has an opinion about this.
> > >
> > > My gut reaction would be 'hell no'. There's other, structural
> > > problems with this code too, and doing some saner naming would
> > > mostly be a sed job and would take minimal amount of time. The
> > > naming can still be intuitive. The symbols from the documentation
> > > can perhaps be mentioned in a couple of comments to establish a
> > > mapping.
> >
> > I think I disagree. For those identifiers which map 1:1 with the
> > manufacturer's document, the ugliness involved in exactly copying
> > the manufacturer's chosen identifiers is outweighed by the benefit
> > of exactly copying the manufacturer's chosen identifiers.
> >
> > Of course, we don't have to use StinkyIdentifiers anywhere else.
> > And the nice thing about that is that when one reads the code and
> > comes across a StinkyIdentifier, one immeditely knows that it's an
> > AMD-provided thing rather than a Linux-provided thing.
> >
> > Zillions of StinkyIdentifiers get merged via this logic.
>
> Andrew, for heaven's sake, please review the patchset - as i did.
Let me apologize for this rude reply ... it appears we do agree, i
just didnt properly read your paragraphs above :-/
What i point out below is precisely what you say is ineligible
under:
> > Of course, we don't have to use StinkyIdentifiers anywhere else.
I'd extend that rule to say that StinkyIdentifiers should only be
used for hw API definitions/constants - macros, enums - not really
local variable names. The moment they are allowed into local
variables the stuff below happens.
Thanks,
Ingo
>
> The thing is, up to 12/21, the patches look like normal Linux
> patches. (there's problems with them too, but on a different level)
>
> Then do the StinkyIdentifiers show up, in full force:
>
> +static int f10_match_to_this_node(struct amd64_pvt *pvt, int DramRange,
> + u64 SystemAddr,
> + int *node_id,
> + int *channel_select)
> +{
> + int CSFound = -1;
> + int NodeID;
> + int HiRangeSelected;
> + u32 IntlvEn, IntlvSel;
> + u32 DramEn;
> + u32 Ilog;
> + u32 HoleOffset, HoleEn;
> + u32 InputAddr, Temp;
> + u32 DctSelBaseAddr, DctSelIntLvAddr;
> + u32 DctSelHi;
> + u32 ChannelSelect;
> + u64 DramBaseLong, DramLimitLong;
> + u64 DctSelBaseOffsetLong, ChannelAddrLong;
>
> Tell me, how is 'SystemAddr' or 'Temp' or 'Ilog' an AMD document
> thing?
>
> I have a much simpler explanation really: someone got really bored
> at converting some code written For Another OS, somewhere in the
> middle - and started plopping Other OS Code into a Linux driver ...
>
> I dont mind the occasional _constant_ that tells us a hw API detail
> in whatever externally dictated style - but this thing stinks
> HeadToToe ... ;-)
>
> Ingo
next prev parent reply other threads:[~2009-04-29 20:48 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-29 16:54 [RFC PATCH 00/21 v2] amd64_edac: EDAC module for AMD64 Borislav Petkov
2009-04-29 16:54 ` [PATCH 01/21] x86: add methods for writing of an MSR on several CPUs Borislav Petkov
2009-04-29 17:39 ` H. Peter Anvin
2009-05-04 16:46 ` Borislav Petkov
2009-05-04 17:25 ` H. Peter Anvin
2009-05-04 17:53 ` Borislav Petkov
2009-05-04 20:51 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 02/21] amd64_edac: add PCI config register defines Borislav Petkov
2009-05-04 20:54 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 03/21] amd64_edac: add driver structs Borislav Petkov
2009-05-04 20:38 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 04/21] amd64_edac: add memory scrubber interface Borislav Petkov
2009-05-04 21:02 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 05/21] amd64_edac: add sys addr to memory controller mapping helpers Borislav Petkov
2009-05-04 21:08 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 06/21] amd64_edac: add functionality to compute the DRAM hole Borislav Petkov
2009-05-04 21:22 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 07/21] amd64_edac: add DRAM address type conversion facilities Borislav Petkov
2009-05-04 21:39 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 08/21] amd64_edac: add helper to dump relevant registers Borislav Petkov
2009-05-04 21:43 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 09/21] amd64_edac: assign DRAM chip select base and mask in a family-specific way Borislav Petkov
2009-05-04 21:59 ` Mauro Carvalho Chehab
2009-05-05 10:25 ` Borislav Petkov
2009-04-29 16:54 ` [PATCH 10/21] amd64_edac: add k8-specific methods Borislav Petkov
2009-05-04 22:06 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 11/21] amd64_edac: add f10-and-later methods-p1 Borislav Petkov
2009-05-04 22:10 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 12/21] amd64_edac: add f10-and-later methods-p2 Borislav Petkov
2009-05-04 23:25 ` Mauro Carvalho Chehab
2009-04-29 16:54 ` [PATCH 13/21] amd64_edac: add f10-and-later methods-p3 Borislav Petkov
2009-04-29 18:22 ` Ingo Molnar
2009-04-29 18:24 ` Ingo Molnar
2009-04-29 19:05 ` Andrew Morton
2009-04-29 19:23 ` Ingo Molnar
2009-04-29 19:42 ` Andrew Morton
2009-04-29 19:53 ` Ingo Molnar
2009-04-29 20:47 ` Ingo Molnar [this message]
2009-04-30 10:01 ` Borislav Petkov
2009-04-30 10:42 ` Ingo Molnar
2009-05-04 23:36 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 14/21] amd64_edac: add per-family descriptors Borislav Petkov
2009-05-04 23:39 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 15/21] amd64_edac: add ECC chipkill syndrome mapping table Borislav Petkov
2009-05-04 23:42 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 16/21] amd64_edac: add error decoding logic Borislav Petkov
2009-04-29 18:19 ` Ingo Molnar
2009-05-04 23:48 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 17/21] amd64_edac: add EDAC core-related initializers Borislav Petkov
2009-05-04 23:53 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 18/21] amd64_edac: add ECC reporting initializers Borislav Petkov
2009-05-04 23:59 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 19/21] amd64_edac: add debugging/testing code Borislav Petkov
2009-04-29 18:18 ` Ingo Molnar
2009-04-29 16:55 ` [PATCH 20/21] amd64_edac: add DRAM error injection logic using sysfs Borislav Petkov
2009-04-29 18:17 ` Ingo Molnar
2009-05-05 0:06 ` Mauro Carvalho Chehab
2009-04-29 16:55 ` [PATCH 21/21] amd64_edac: add module registration routines Borislav Petkov
2009-05-05 0:10 ` Mauro Carvalho Chehab
2009-04-29 19:30 ` [RFC PATCH 00/21 v2] amd64_edac: EDAC module for AMD64 Andi Kleen
2009-04-30 11:57 ` Borislav Petkov
2009-04-30 12:21 ` Ingo Molnar
2009-04-30 12:47 ` Andi Kleen
2009-04-30 14:48 ` Aristeu Rozanski
2009-05-01 7:53 ` Borislav Petkov
2009-05-03 0:32 ` Aristeu Rozanski
2009-04-30 18:37 ` Mauro Carvalho Chehab
2009-05-01 12:39 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2009-04-30 6:21 [PATCH 13/21] amd64_edac: add f10-and-later methods-p3 Doug Thompson
2009-05-05 19:30 Doug Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090429204730.GA24298@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=borislav.petkov@amd.com \
--cc=dougthompson@xmission.com \
--cc=greg@kroah.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox