On Wed, Mar 16, 2011 at 05:04:43PM -0500, Anthony Liguori wrote: > On 03/15/2011 11:56 PM, David Gibson wrote: [snip] > >+static int spapr_vio_busdev_init(DeviceState *dev, DeviceInfo *info) > >+{ > >+ VIOsPAPRDeviceInfo *_info = (VIOsPAPRDeviceInfo *)info; > >+ VIOsPAPRDevice *_dev = (VIOsPAPRDevice *)dev; > >+ char *id; > >+ > >+ if (asprintf(&id, "%s@%x", _info->dt_name, _dev->reg)< 0) { > >+ return -1; > >+ } > >+ > >+ _dev->qdev.id = id; > >+ > >+ return _info->init(_dev); > > The C standard actually reserves the _ and __ namespaces for > compilers and system headers. The kernel can get away with it > because it doesn't use system headers but we've had trouble with > this in QEMU.
Ok, I was just following the example of the s390 code here. Nonetheless I've changed it. [snip] > >+ if (info->hcalls) > >+ info->hcalls(bus); > > Got a little sloppy with braces here.. Not so much sloppy as just very, very used to the kernel style. [snip] > We have a checkpatch.pl in the tree. I'd suggest using that to get > rid of the rest of the CODING_STYLE issues which I'll stop > commenting on. Yeah, believe it or not I did already fix up a lot of these. I thought I'd got nearly all of them, but obviously not :(. Either that or I did get them and lost the changes in the git mishap I had a while back. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson