On Wed, Dec 05, 2012 at 03:03:27PM +0800, Wanlong Gao wrote: > to_vp_device is worth changing to inlined definition. > > Signed-off-by: Wanlong Gao <gaowanlong@xxxxxxxxxxxxxx> I don't think it's worth it. The oldest gcc I happened to have around is 4.3.3 which is already smart enough to generate identical code before and after the patch. And a function is cleaner. > --- > drivers/virtio/virtio_pci.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c > index e3ecc94..7681fe3 100644 > --- a/drivers/virtio/virtio_pci.c > +++ b/drivers/virtio/virtio_pci.c > @@ -98,11 +98,7 @@ static struct pci_device_id virtio_pci_id_table[] = { > > MODULE_DEVICE_TABLE(pci, virtio_pci_id_table); > > -/* Convert a generic virtio device to our structure */ > -static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev) > -{ > - return container_of(vdev, struct virtio_pci_device, vdev); > -} > +#define to_vp_device(_vdev) container_of(_vdev, struct virtio_pci_device, vdev) > > /* virtio config->get_features() implementation */ > static u32 vp_get_features(struct virtio_device *vdev) > -- > 1.8.0 _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization