Re: [PATCH] vfio: Split virqfd into a separate module for vfio bus drivers

From: Alex Williamson
Date: Thu Mar 19 2015 - 16:12:18 EST


On Thu, 2015-03-19 at 20:32 +0100, Paul Bolle wrote:
> On Wed, 2015-03-18 at 11:27 -0600, Alex Williamson wrote:
> > --- a/drivers/vfio/virqfd.c
> > +++ b/drivers/vfio/virqfd.c
>
> > +#define DRIVER_VERSION "0.1"
> > +#define DRIVER_AUTHOR "Alex Williamson <alex.williamson@xxxxxxxxxx>"
> > +#define DRIVER_DESC "IRQFD support for VFIO bus drivers"
>
> > +MODULE_VERSION(DRIVER_VERSION);
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_AUTHOR(DRIVER_AUTHOR);
> > +MODULE_DESCRIPTION(DRIVER_DESC);
>
> Why bother with those three defines? They're all used just once, aren't
> they?

Well, at some point when I was doing vfio it seemed like a good idea and
I copied it from another driver. The core vfio module printed the
description and version on driver loading, but the other modules that
comprise vfio just followed along for consistency. Now we even have a
few more modules that comprise vfio, and they all follow this same
standard, even though they don't use the defines elsewhere. The macro
names are pretty standard, so I don't think I'm infringing on any name
space by using them, it seems harmless otherwise and maintains
consistency within the driver. Is it more valuable to remove a few
lines of source code with no net effect on the resulting output?
Besides, look at how much more aesthetically pleasing the above is
versus this:

MODULE_VERSION("0.1");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Alex Williamson <alex.williamson@xxxxxxxxxx>");
MODULE_DESCRIPTION("IRQFD support for VFIO bus drivers");

;)

Thanks,

Alex

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/