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] Re: [PATCH 5/7] Xen: fix whitespaces, tabs coding style

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH 5/7] Xen: fix whitespaces, tabs coding style issue in drivers/xen/xenbus/xenbus_client.c
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 26 Jul 2011 17:31:38 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "ruslanpisarev@xxxxxxxxx" <ruslanpisarev@xxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, Ruslan Pisarev <ruslan@xxxxxxxxxxxxxxx>, "virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx" <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>
Delivery-date: Tue, 26 Jul 2011 09:32:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E2EE8AC.1090703@xxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <1311679009-16659-1-git-send-email-ruslan@xxxxxxxxxxxxxxx> <4E2EE8AC.1090703@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2011-07-26 at 12:17 -0400, Jeremy Fitzhardinge wrote:
> On 07/26/2011 04:16 AM, ruslanpisarev@xxxxxxxxx wrote:
> > @@ -43,15 +43,15 @@
> >  const char *xenbus_strstate(enum xenbus_state state)
> >  {
> >     static const char *const name[] = {
> > -           [ XenbusStateUnknown      ] = "Unknown",
> > -           [ XenbusStateInitialising ] = "Initialising",
> > -           [ XenbusStateInitWait     ] = "InitWait",
> > -           [ XenbusStateInitialised  ] = "Initialised",
> > -           [ XenbusStateConnected    ] = "Connected",
> > -           [ XenbusStateClosing      ] = "Closing",
> > -           [ XenbusStateClosed       ] = "Closed",
> > -           [XenbusStateReconfiguring] = "Reconfiguring",
> > -           [XenbusStateReconfigured] = "Reconfigured",
> > +           [XenbusStateUnknown] =          "Unknown",
> > +           [XenbusStateInitialising] =     "Initialising",
> > +           [XenbusStateInitWait] =         "InitWait",
> > +           [XenbusStateInitialised] =      "Initialised",
> > +           [XenbusStateConnected] =        "Connected",
> > +           [XenbusStateClosing] =          "Closing",
> > +           [XenbusStateClosed] =           "Closed",
> > +           [XenbusStateReconfiguring] =    "Reconfiguring",
> > +           [XenbusStateReconfigured] =     "Reconfigured",
> >     };
> 
> Eh, I think this looks worse now.

Me too.

If we're going to change this to anything I'd suggest
#define N(x) [XenbusState#x] = ##x
...
         N(Connected),
         N(Closing),
...
#undef N

(modulo my never quite remembering the cpp stringification rules first
time)

Ian.


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