AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20070706134905.15e02105@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<maxim.kozlovsky@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E046A88D2@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 6 Jul 2007 13:49:58 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>
Subject: Re: Please review
Message-ID: <20070706134958.67521fc3@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E046A88D2@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E045C1535@onstor-exch02.onstor.net>
	<20070705183902.078a1abc@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E046A88D2@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Fri, 6 Jul 2007 13:22:50 -0700 "Maxim Kozlovsky"
<maxim.kozlovsky@onstor.com> wrote:

> 
> 
> >-----Original Message-----
> >From: Andy Sharp
> >Sent: Thursday, July 05, 2007 6:39 PM
> >To: Maxim Kozlovsky
> >Subject: Re: Please review
> >
> >On Mon, 2 Jul 2007 18:02:40 -0700 "Maxim Kozlovsky"
> ><maxim.kozlovsky@onstor.com> wrote:
> >
> >> Change 24434 by maximk@maximk-5 on 2007/07/02 17:57:22 *pending*
> >>
> >>         mgmtbus port to linux. fragmentation support.
> >>
> >> Affected files ...
> >>
> >> ...
> >>
> //depot/cougar/linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/mgmt-bus
> >> .c#1 edit
> >> ...
> >>
> //depot/cougar/linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/mgmt-bus
> >> .h#1 add
> >> ...
> >>
> //depot/cougar/linux/kernel/linux-mips-2.6/include/net/neteee/edesc.h#1
> >> add
> >> ...
> >> //depot/cougar/linux/kernel/linux-mips-2.6/include/net/neteee/eee.h#2
> >> edit
> >> ... //depot/cougar/linux/kernel/linux-mips-2.6/net/neteee/neteee.c#2
> >> edit
> >> ... //depot/cougar/nfx-tree/code/sm-anpssc/anpssctest.c#1 edit
> >>
> >
> >linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/mgmt-bus.c
> >
> >     we need to review some of these files together, this one is a
> >     candidate for that, but here is some low hanging fruit:
> >
> >     line 133
> >     what is Mips_IOSyncDCache?  there are standard kernel functions
> >for this.
> [MK] There must be. What is it?
> >
> >     line 141
> >     #define MGMT_BUTT_ALIGN ALIGN(addr, 32)
> [MK] OK
> >
> >     line 151
> >     why do you need the qualifiers?  virt-to-phys and phys-to-virt
> >     should work fine no matter what.   i thought this was all done
> with a
> >     PCI driver anyway.  That's what you said when I asked you if the
> >     mgmt_bus driver used these shared memory areas.
> [MK] Always using virt_to_phys/phys_to_virt does not work for some
> reason, probably because what it is calling "phys address" is not
> exactly a "phys address" for Linux.

Maybe because it isn't mapping that memory that way.  You might be
fiddling all over the place and not even know it.  These functions are
stupidly simple, they don't do anything more than what you've got
there.  They're supposed to "never" be used in drivers.  Of course,
that's exactly what I use in the natsemi and mpsc drivers ~:^) What
memory address range are you using it on?  

> >
> >     line 184, 186, 247, 376
> >     no Studly Caps, PlEaSe
> >     btw, why does tim get the blame for all these functions? ~:^)
> >
> >     line 537, 543, etc
> >     consistent commenting style?  except for debugging code which
> > will eventually be deleted, C++ commenting should not be used.
> >
> [MK] Because he wrote it originally. I preserved the original style
> whenever possible including the Caps, comments, lines going pass the
> end of the screen, braces etc.

crap should be de-crapped.  i simply can't have the kernel polluted
with this userspace shiite.  C++ and Obj-C can use caps, it should be
punishable by death anywhere else.  you can leave the typedef struct
crap.  it's too hot outside to take time fixing that shit.

i'll make you a deal: I'll do the thing with the function prototype and
the header file for ds1511.h, if you de-cap-itate this stuff.

> >     line 629
> >     ooh, nice use of MV_WRITE
> >     there are kernel macros for handling the c0 and cause registers,
> >     we can hunt those down.
> [MK] I don't think so, this is the inbound message register, the
> interpretation is entirely user-defined.

oops, duh, yeah, i'm blind or something

> >     all the functions which don't have comments need to have
> > comments added above them.  i don't give a !@#% about using some
> > template, but you can if you want.  i care that the style is kernel
> > style so
> it
> >     doesn't look like 10 different people wrote this spaghetti code.
> >
> >     pretty good first cut of this driver, i must say.
> >
> >linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/mgmt-bus.h
> >
> >     >>add
> >     >>linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/mgmt-bus.h
> >
> >     fix all the trailing whitespace, and no, this is not an approved
> >     style:
> >
> >     typedef struct
> >     {
> >     	...
> >     } foo_eatme_t;
> >
> >     In fact, we should not be using typedef struct anyway, it's
> > really monkey spank microsoft donkey coding.  simply define the
> >     structure(s), and declare variables to be struct foo.  typedefs
> are a
> >     useless form of obfuscation that leads to confusion and long
> >     maintenance periods. they also compile _really_ slowly.
> >
> >     fix the comment style please! thank you!
> >
> >     line 64
> >     excellent
> >
> >linux/kernel/linux-mips-2.6/include/net/neteee/edesc.h
> >
> >     >>add linux/kernel/linux-mips-2.6/include/net/neteee/edesc.h
> >
> >     fix the #!^!#$%! trailing whitespace....
> >
> >     comments are
> >
> >     /*
> >      * foo
> >      */
> [MK] OK
> >
> >
> >linux/kernel/linux-mips-2.6/include/net/neteee/eee.h
> >
> >     looks good
> >
> >linux/kernel/linux-mips-2.6/net/neteee/neteee.c
> >
> >     line 47
> >     hmm, just trying to mess with the c-preprocessor?
> >
> >     line 746
> >     since you're just copying the data into and outa skb's, why not
> use
> >     uncached addresses exclusively for share memory regions?  unless
> >     there are some places where we just add a pointer into a
> structure,
> >     but that is dangerous so i hope we aren't doing that.
> [MK] Huh?

which word didn't you understand?  we don't need cache routines if you
use uncached addresses.  ja-know what i mean?

> >nfx-tree/code/sm-anpssc/anpssctest.c
> >
> >     looks good
> 
