Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1430453 > unrolled thread

[PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV

Started byJiri Kosina <jikos@kernel.org>
First post2016-06-24 10:30 +0200
Last post2016-06-24 11:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV Jiri Kosina <jikos@kernel.org> - 2016-06-24 10:30 +0200
    Re: [PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV Jiri Kosina <jikos@kernel.org> - 2016-06-24 11:10 +0200
    Re: [PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV Arnd Bergmann <arnd@arndb.de> - 2016-06-24 11:10 +0200

#1430453 — [PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV

FromJiri Kosina <jikos@kernel.org>
Date2016-06-24 10:30 +0200
Subject[PATCH] HID: hiddev: use IS_ENABLED() for USB_HIDDEV
Message-ID<rNuEV-5Fl-3@gated-at.bofh.it>
From: Jiri Kosina <jkosina@suse.cz>

Use IS_ENABLED() for checking USB_HIDDEV to make sure compilation works 
for all possible config combinations.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 include/linux/hiddev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
index a5dd814..b6f48d6 100644
--- a/include/linux/hiddev.h
+++ b/include/linux/hiddev.h
@@ -37,7 +37,7 @@ struct hid_usage;
 struct hid_field;
 struct hid_report;
 
-#ifdef CONFIG_USB_HIDDEV
+#if IS_ENABLED(CONFIG_USB_HIDDEV)
 int hiddev_connect(struct hid_device *hid, unsigned int force);
 void hiddev_disconnect(struct hid_device *);
 void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,

-- 
Jiri Kosina
SUSE Labs

[toc] | [next] | [standalone]


#1430483

FromJiri Kosina <jikos@kernel.org>
Date2016-06-24 11:10 +0200
Message-ID<rNvhE-6a1-33@gated-at.bofh.it>
In reply to#1430453
On Fri, 24 Jun 2016, Arnd Bergmann wrote:

> On Friday, June 24, 2016 10:28:50 AM CEST Jiri Kosina wrote:
> > From: Jiri Kosina <jkosina@suse.cz>
> > 
> > Use IS_ENABLED() for checking USB_HIDDEV to make sure compilation works 
> > for all possible config combinations.
> > 
> > Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> > ---
> >  include/linux/hiddev.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
> > index a5dd814..b6f48d6 100644
> > --- a/include/linux/hiddev.h
> > +++ b/include/linux/hiddev.h
> > @@ -37,7 +37,7 @@ struct hid_usage;
> >  struct hid_field;
> >  struct hid_report;
> >  
> > -#ifdef CONFIG_USB_HIDDEV
> > +#if IS_ENABLED(CONFIG_USB_HIDDEV)
> >  int hiddev_connect(struct hid_device *hid, unsigned int force);
> >  void hiddev_disconnect(struct hid_device *);
> >  void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
> > 
> > 
> 
> CONFIG_USB_HIDDEV is a 'bool' option, so the two look completely
> equivalent.
> 
> If we wanted to make USB_HIDDEV a loadable module by itself,
> we'd also need to export those functions and change both the Kconfig
> and Makefile files to ensure that you can't have USB_HIDDEV=m
> in combination with USB_HID=y.
> 
> What problem are you trying to fix specifically?

This mail was by my mistake generated from my private git tree; sorry for 
the noise, feel free to ignore it.

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1430491

FromArnd Bergmann <arnd@arndb.de>
Date2016-06-24 11:10 +0200
Message-ID<rNvhE-6a1-35@gated-at.bofh.it>
In reply to#1430453
On Friday, June 24, 2016 10:28:50 AM CEST Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@suse.cz>
> 
> Use IS_ENABLED() for checking USB_HIDDEV to make sure compilation works 
> for all possible config combinations.
> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> ---
>  include/linux/hiddev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
> index a5dd814..b6f48d6 100644
> --- a/include/linux/hiddev.h
> +++ b/include/linux/hiddev.h
> @@ -37,7 +37,7 @@ struct hid_usage;
>  struct hid_field;
>  struct hid_report;
>  
> -#ifdef CONFIG_USB_HIDDEV
> +#if IS_ENABLED(CONFIG_USB_HIDDEV)
>  int hiddev_connect(struct hid_device *hid, unsigned int force);
>  void hiddev_disconnect(struct hid_device *);
>  void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
> 
> 

CONFIG_USB_HIDDEV is a 'bool' option, so the two look completely
equivalent.

If we wanted to make USB_HIDDEV a loadable module by itself,
we'd also need to export those functions and change both the Kconfig
and Makefile files to ensure that you can't have USB_HIDDEV=m
in combination with USB_HID=y.

What problem are you trying to fix specifically?

	Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web