From: "Jan Beulich" Subject: Re: [PATCH] xen: remove DEFINE_XENBUS_DRIVER() macro Date: Tue, 09 Sep 2014 11:15:30 +0100 Message-ID: <540EEF62020000780003285B@mail.emea.novell.com> References: <1410194802-2848-1-git-send-email-david.vrabel@citrix.com> <540EE58D020000780003275B@mail.emea.novell.com> <540ECE35.10503@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRISV-0005tE-H2 for xen-devel@lists.xenproject.org; Tue, 09 Sep 2014 10:15:35 +0000 In-Reply-To: <540ECE35.10503@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org >>> On 09.09.14 at 11:53, wrote: > On 09/09/14 10:33, Jan Beulich wrote: >>>>> On 08.09.14 at 18:46, wrote: >>> The DEFINE_XENBUS_DRIVER() macro looks a bit weird and causes sparse >>> errors. >>> >>> Replace the uses with standard structure definitions instead. This is >>> similar to pci and usb device registration. >>> >>> Signed-off-by: David Vrabel >> >> I really regret you doing this, re-adding redundancy the elimination >> of which the macro got added for (the diffstat would look even less >> favorable if your patch didn't eliminate a couple of bogus comments >> and blank lines). I'm certainly not in the position to nack this patch, >> but if I was I would. > > There didn't seem to be a good reason to require that the driver name > match the first device ID. What should the driver be named if it was > for two or more different types of Xenbus device? Is that a reasonable thing to expect? > And not all drivers did this anyway. > > However, we could do: > > drv->driver.name = drv->name ? drv->name : drv->ids[0]; > > What that resolve your concern? Only partly - to some degree I also prefer the slightly more terse code resulting from the macro use. And the original motivation was anyway to allow reuse of upstream driver code in our forward ported kernel without needing to patch each individual instance (iirc largely needed to keep unmodified_drivers/ building, which would otherwise break due to e.g. new fields in .driver needing initialization). Jan