From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v2 04/12] xen/arm: device: Rename device_type into device_match Date: Tue, 27 Jan 2015 16:05:15 +0000 Message-ID: References: <1421418247-30068-1-git-send-email-julien.grall@linaro.org> <1421418247-30068-5-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YG8e0-0004lH-Pt for xen-devel@lists.xenproject.org; Tue, 27 Jan 2015 16:05:36 +0000 In-Reply-To: <1421418247-30068-5-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 16 Jan 2015, Julien Grall wrote: > This enum was used for matching a specific device and not to get the > type of device. > > Hence the name device_type will be used for another purpose later. > > Signed-off-by: Julien Grall If you really want to rename this field, please find a more descriptive name for it. device_match doesn't really tell me what we are trying to match against. At least device_type would tell me that we are matching against the type. > xen/arch/arm/device.c | 4 ++-- > xen/include/asm-arm/device.h | 8 ++++---- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c > index 59e94c0..693b9af 100644 > --- a/xen/arch/arm/device.c > +++ b/xen/arch/arm/device.c > @@ -40,7 +40,7 @@ static bool_t __init device_is_compatible(const struct device_desc *desc, > return 0; > } > > -int __init device_init(struct dt_device_node *dev, enum device_type type, > +int __init device_init(struct dt_device_node *dev, enum device_match type, > const void *data) > { > const struct device_desc *desc; > @@ -67,7 +67,7 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, > return -EBADF; > } > > -enum device_type device_get_type(const struct dt_device_node *dev) > +enum device_match device_get_type(const struct dt_device_node *dev) > { > const struct device_desc *desc; > > diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h > index 74a80c6..72a9028 100644 > --- a/xen/include/asm-arm/device.h > +++ b/xen/include/asm-arm/device.h > @@ -4,7 +4,7 @@ > #include > #include > > -enum device_type > +enum device_match > { > DEVICE_SERIAL, > DEVICE_IOMMU, > @@ -17,7 +17,7 @@ struct device_desc { > /* Device name */ > const char *name; > /* Device type */ > - enum device_type type; > + enum device_match type; > /* Array of device tree 'compatible' strings */ > const char *const *compatible; > /* Device initialization */ > @@ -32,7 +32,7 @@ struct device_desc { > * > * Return 0 on success. > */ > -int __init device_init(struct dt_device_node *dev, enum device_type type, > +int __init device_init(struct dt_device_node *dev, enum device_match type, > const void *data); > > /** > @@ -41,7 +41,7 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, > * > * Return the device type on success or DEVICE_ANY on failure > */ > -enum device_type device_get_type(const struct dt_device_node *dev); > +enum device_match device_get_type(const struct dt_device_node *dev); > > #define DT_DEVICE_START(_name, _namestr, _type) \ > static const struct device_desc __dev_desc_##_name __used \ > -- > 2.1.4 >