WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] USB virt 2.6 split driver patch series

To: harry <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] USB virt 2.6 split driver patch series
From: NAHieu <nahieu@xxxxxxxxx>
Date: Tue, 22 Nov 2005 00:27:05 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxx>
Delivery-date: Mon, 21 Nov 2005 15:27:05 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AO4ZvXCgJ2EmNLszDY7IXY89hs3kw1LCfcs5miYR135IuPkT98nraflFc0h+GdZn+EwOnpbq039T8l5ROv/avj5M5gFcAaRmSyoRsfModJS8WGi5FBddbIvhHJ+UEMFvKZNsJT1dBgoCwz/t4DcRpeDfFPWdvl4t5xYzhXu9LzU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1132586050.31295.145.camel@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1132579104.31295.110.camel@xxxxxxxxxxxxxxxxxxxxx> <20051121134940.GA25045@xxxxxxxxx> <1132581661.31295.134.camel@xxxxxxxxxxxxxxxxxxxxx> <5d7aca950511210641n23d79fduc2e462c3dcd07810@xxxxxxxxxxxxxx> <1132586050.31295.145.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 11/22/05, harry <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, 2005-11-21 at 23:41 +0900, NAHieu wrote:
> > On 11/21/05, harry <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > > On Mon, 2005-11-21 at 14:49 +0100, Vincent Hanquez wrote:
> > > > On Mon, Nov 21, 2005 at 01:18:24PM +0000, harry wrote:
> > > > > o - I've reformatted all the code to the kernel coding style using
> > > > > Lindent and not attempted to improve it after that.  Some of the
> > > > > formatting needs to be improved.
> > > >
> > > > some ? this is totally _not_ linux kernel coding style.
> > > > please have a look at Documentation/CodingStyle and kill anonymous
> > > > inline functions (braces in middle of functions).
> > > >
> > >
> > > I have read  Documentation/CodingStyle quite carefully and there is no
> > > mention of using braces inside functions.  I'm used to using braces to
> > > define minimal scopes for local variables which makes the code easier to
> > > read by minimising the number of variables you need to keep track of
> > > when reading it and by declaring variables closer to where they are used
> > > so it is easier to verify that they have been correctly initialised.
> > >
> > > Is this really banned?
> > >
> >
> > I guess people complain because this is not a common practice. At
> > least I never seen any code like that in the kernel.
> >
> > You could remove them because your functions are pretty short, and it
> > easy enough to follow the code even if you put all the variables at
> > the top of functions.
>
> Yes, I can do this if necessary.  I like to put a trace point at the
> start of functions before declaring varibles because some variable
> initialisations result in calls to other functions and having the
> tracepoint first gets the trace log in the correct order.  The
> alternative is to put the declaration first and then initialise after
> the trace point.  I'm not used to 8 space tabs either.  The braces for
> nested scope don't really work well with such big tabs.

why you care about 8 space tabs? Just use tabs to align the code, and
don't pay attention to how many spaces to a tab.

If you think 8 spaces is too long, you could reconfigure your editor.
For example I use vim as editor, and configure it to display 4 spaces
for 1 tab (set shiftwidth=4), and the code looks much better.

>
> Lindent also messed up by putting the starting open brace for a number
> of functions after the parameters rather than at the start of a new
> line.  There are also some problems from Lindent with parameter lists
> being formatted in a confusing way.  I need to go through and fix these
> issues

Beside spliting the code and send them to the list, could you send a
whole in 1 file only? I want to patch it to my tree and give it a try.
Downloading 17 files separately and patch them is tired ;-)

Hieu

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel