linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h
@ 2020-02-05  9:48 Andy Shevchenko
  2020-02-10 14:57 ` Andy Shevchenko
  2020-02-11  9:44 ` Enric Balletbo i Serra
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-02-05  9:48 UTC (permalink / raw)
  To: Enric Balletbo i Serra, Nick Crews, linux-kernel, Daniel Campello
  Cc: Andy Shevchenko

Replace with appropriate types.h.

Also there is no need to include device.h, but mutex.h.
For the pointers to unknown structures use forward declarations.

In the *.c files we need to include all headers that provide APIs
being used in the module.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: update *.c files (kbuild test robot)
 drivers/platform/chrome/wilco_ec/properties.c | 3 +++
 drivers/platform/chrome/wilco_ec/sysfs.c      | 4 ++++
 include/linux/platform_data/wilco-ec.h        | 8 ++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/wilco_ec/properties.c b/drivers/platform/chrome/wilco_ec/properties.c
index e69682c95ea2..a0cbd8bd2851 100644
--- a/drivers/platform/chrome/wilco_ec/properties.c
+++ b/drivers/platform/chrome/wilco_ec/properties.c
@@ -3,8 +3,11 @@
  * Copyright 2019 Google LLC
  */
 
+#include <linux/errno.h>
+#include <linux/export.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/string.h>
+#include <linux/types.h>
 #include <linux/unaligned/le_memmove.h>
 
 /* Operation code; what the EC should do with the property */
diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c
index f0d174b6bb21..3c587b4054a5 100644
--- a/drivers/platform/chrome/wilco_ec/sysfs.c
+++ b/drivers/platform/chrome/wilco_ec/sysfs.c
@@ -8,8 +8,12 @@
  * See Documentation/ABI/testing/sysfs-platform-wilco-ec for more information.
  */
 
+#include <linux/device.h>
+#include <linux/kernel.h>
 #include <linux/platform_data/wilco-ec.h>
+#include <linux/string.h>
 #include <linux/sysfs.h>
+#include <linux/types.h>
 
 #define CMD_KB_CMOS			0x7C
 #define SUB_CMD_KB_CMOS_AUTO_ON		0x03
diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h
index afede15a95bf..25f46a939637 100644
--- a/include/linux/platform_data/wilco-ec.h
+++ b/include/linux/platform_data/wilco-ec.h
@@ -8,8 +8,8 @@
 #ifndef WILCO_EC_H
 #define WILCO_EC_H
 
-#include <linux/device.h>
-#include <linux/kernel.h>
+#include <linux/mutex.h>
+#include <linux/types.h>
 
 /* Message flags for using the mailbox() interface */
 #define WILCO_EC_FLAG_NO_RESPONSE	BIT(0) /* EC does not respond */
@@ -17,6 +17,10 @@
 /* Normal commands have a maximum 32 bytes of data */
 #define EC_MAILBOX_DATA_SIZE		32
 
+struct device;
+struct resource;
+struct platform_device;
+
 /**
  * struct wilco_ec_device - Wilco Embedded Controller handle.
  * @dev: Device handle.
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h
  2020-02-05  9:48 [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h Andy Shevchenko
@ 2020-02-10 14:57 ` Andy Shevchenko
  2020-02-10 15:03   ` Enric Balletbo i Serra
  2020-02-11  9:44 ` Enric Balletbo i Serra
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-02-10 14:57 UTC (permalink / raw)
  To: Enric Balletbo i Serra, Nick Crews, linux-kernel, Daniel Campello

On Wed, Feb 05, 2020 at 11:48:28AM +0200, Andy Shevchenko wrote:
> Replace with appropriate types.h.
> 
> Also there is no need to include device.h, but mutex.h.
> For the pointers to unknown structures use forward declarations.
> 
> In the *.c files we need to include all headers that provide APIs
> being used in the module.

Anybody to comment?

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: update *.c files (kbuild test robot)
>  drivers/platform/chrome/wilco_ec/properties.c | 3 +++
>  drivers/platform/chrome/wilco_ec/sysfs.c      | 4 ++++
>  include/linux/platform_data/wilco-ec.h        | 8 ++++++--
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/chrome/wilco_ec/properties.c b/drivers/platform/chrome/wilco_ec/properties.c
> index e69682c95ea2..a0cbd8bd2851 100644
> --- a/drivers/platform/chrome/wilco_ec/properties.c
> +++ b/drivers/platform/chrome/wilco_ec/properties.c
> @@ -3,8 +3,11 @@
>   * Copyright 2019 Google LLC
>   */
>  
> +#include <linux/errno.h>
> +#include <linux/export.h>
>  #include <linux/platform_data/wilco-ec.h>
>  #include <linux/string.h>
> +#include <linux/types.h>
>  #include <linux/unaligned/le_memmove.h>
>  
>  /* Operation code; what the EC should do with the property */
> diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c
> index f0d174b6bb21..3c587b4054a5 100644
> --- a/drivers/platform/chrome/wilco_ec/sysfs.c
> +++ b/drivers/platform/chrome/wilco_ec/sysfs.c
> @@ -8,8 +8,12 @@
>   * See Documentation/ABI/testing/sysfs-platform-wilco-ec for more information.
>   */
>  
> +#include <linux/device.h>
> +#include <linux/kernel.h>
>  #include <linux/platform_data/wilco-ec.h>
> +#include <linux/string.h>
>  #include <linux/sysfs.h>
> +#include <linux/types.h>
>  
>  #define CMD_KB_CMOS			0x7C
>  #define SUB_CMD_KB_CMOS_AUTO_ON		0x03
> diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h
> index afede15a95bf..25f46a939637 100644
> --- a/include/linux/platform_data/wilco-ec.h
> +++ b/include/linux/platform_data/wilco-ec.h
> @@ -8,8 +8,8 @@
>  #ifndef WILCO_EC_H
>  #define WILCO_EC_H
>  
> -#include <linux/device.h>
> -#include <linux/kernel.h>
> +#include <linux/mutex.h>
> +#include <linux/types.h>
>  
>  /* Message flags for using the mailbox() interface */
>  #define WILCO_EC_FLAG_NO_RESPONSE	BIT(0) /* EC does not respond */
> @@ -17,6 +17,10 @@
>  /* Normal commands have a maximum 32 bytes of data */
>  #define EC_MAILBOX_DATA_SIZE		32
>  
> +struct device;
> +struct resource;
> +struct platform_device;
> +
>  /**
>   * struct wilco_ec_device - Wilco Embedded Controller handle.
>   * @dev: Device handle.
> -- 
> 2.24.1
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h
  2020-02-10 14:57 ` Andy Shevchenko
@ 2020-02-10 15:03   ` Enric Balletbo i Serra
  0 siblings, 0 replies; 4+ messages in thread
From: Enric Balletbo i Serra @ 2020-02-10 15:03 UTC (permalink / raw)
  To: Andy Shevchenko, Nick Crews, linux-kernel, Daniel Campello

Hi Andy,

On 10/2/20 15:57, Andy Shevchenko wrote:
> On Wed, Feb 05, 2020 at 11:48:28AM +0200, Andy Shevchenko wrote:
>> Replace with appropriate types.h.
>>
>> Also there is no need to include device.h, but mutex.h.
>> For the pointers to unknown structures use forward declarations.
>>
>> In the *.c files we need to include all headers that provide APIs
>> being used in the module.
> 
> Anybody to comment?
> 

LGTM, I silently queued this patch this morning in our kernelci branch to give a
try. Waiting for the results, if all goes well will be queued for-next.

Thanks,
 Enric

>>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> v2: update *.c files (kbuild test robot)
>>  drivers/platform/chrome/wilco_ec/properties.c | 3 +++
>>  drivers/platform/chrome/wilco_ec/sysfs.c      | 4 ++++
>>  include/linux/platform_data/wilco-ec.h        | 8 ++++++--
>>  3 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/chrome/wilco_ec/properties.c b/drivers/platform/chrome/wilco_ec/properties.c
>> index e69682c95ea2..a0cbd8bd2851 100644
>> --- a/drivers/platform/chrome/wilco_ec/properties.c
>> +++ b/drivers/platform/chrome/wilco_ec/properties.c
>> @@ -3,8 +3,11 @@
>>   * Copyright 2019 Google LLC
>>   */
>>  
>> +#include <linux/errno.h>
>> +#include <linux/export.h>
>>  #include <linux/platform_data/wilco-ec.h>
>>  #include <linux/string.h>
>> +#include <linux/types.h>
>>  #include <linux/unaligned/le_memmove.h>
>>  
>>  /* Operation code; what the EC should do with the property */
>> diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c
>> index f0d174b6bb21..3c587b4054a5 100644
>> --- a/drivers/platform/chrome/wilco_ec/sysfs.c
>> +++ b/drivers/platform/chrome/wilco_ec/sysfs.c
>> @@ -8,8 +8,12 @@
>>   * See Documentation/ABI/testing/sysfs-platform-wilco-ec for more information.
>>   */
>>  
>> +#include <linux/device.h>
>> +#include <linux/kernel.h>
>>  #include <linux/platform_data/wilco-ec.h>
>> +#include <linux/string.h>
>>  #include <linux/sysfs.h>
>> +#include <linux/types.h>
>>  
>>  #define CMD_KB_CMOS			0x7C
>>  #define SUB_CMD_KB_CMOS_AUTO_ON		0x03
>> diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h
>> index afede15a95bf..25f46a939637 100644
>> --- a/include/linux/platform_data/wilco-ec.h
>> +++ b/include/linux/platform_data/wilco-ec.h
>> @@ -8,8 +8,8 @@
>>  #ifndef WILCO_EC_H
>>  #define WILCO_EC_H
>>  
>> -#include <linux/device.h>
>> -#include <linux/kernel.h>
>> +#include <linux/mutex.h>
>> +#include <linux/types.h>
>>  
>>  /* Message flags for using the mailbox() interface */
>>  #define WILCO_EC_FLAG_NO_RESPONSE	BIT(0) /* EC does not respond */
>> @@ -17,6 +17,10 @@
>>  /* Normal commands have a maximum 32 bytes of data */
>>  #define EC_MAILBOX_DATA_SIZE		32
>>  
>> +struct device;
>> +struct resource;
>> +struct platform_device;
>> +
>>  /**
>>   * struct wilco_ec_device - Wilco Embedded Controller handle.
>>   * @dev: Device handle.
>> -- 
>> 2.24.1
>>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h
  2020-02-05  9:48 [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h Andy Shevchenko
  2020-02-10 14:57 ` Andy Shevchenko
@ 2020-02-11  9:44 ` Enric Balletbo i Serra
  1 sibling, 0 replies; 4+ messages in thread
From: Enric Balletbo i Serra @ 2020-02-11  9:44 UTC (permalink / raw)
  To: Andy Shevchenko, Nick Crews, linux-kernel, Daniel Campello


On 5/2/20 10:48, Andy Shevchenko wrote:
> Replace with appropriate types.h.
> 
> Also there is no need to include device.h, but mutex.h.
> For the pointers to unknown structures use forward declarations.
> 
> In the *.c files we need to include all headers that provide APIs
> being used in the module.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Queued for 5.7, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-11  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05  9:48 [PATCH v2] platform/chrome: wilco_ec: Platform data shan't include kernel.h Andy Shevchenko
2020-02-10 14:57 ` Andy Shevchenko
2020-02-10 15:03   ` Enric Balletbo i Serra
2020-02-11  9:44 ` Enric Balletbo i Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).