public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices
       [not found]         ` <20211029152901.297939-6-linux@weissschuh.net>
@ 2021-11-10 16:44           ` Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
                               ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Nathan Chancellor @ 2021-11-10 16:44 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: linux-input, linux-kernel, Srinivas Pandruvada, Rushikesh S Kadam,
	Jiri Kosina, Benjamin Tissoires, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, llvm

On Fri, Oct 29, 2021 at 05:29:00PM +0200, Thomas Weißschuh wrote:
> Previously it was loaded for all ISHTP devices.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> 
> ---
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: linux-input@vger.kernel.org
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> ---
>  drivers/platform/chrome/cros_ec_ishtp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
> index 9d1e7e03628e..8c17358e84c1 100644
> --- a/drivers/platform/chrome/cros_ec_ishtp.c
> +++ b/drivers/platform/chrome/cros_ec_ishtp.c
> @@ -774,6 +774,12 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
>  	},
>  };
>  
> +static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
> +	{ cros_ish_guid },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
> +
>  static int __init cros_ec_ishtp_mod_init(void)
>  {
>  	return ishtp_cl_driver_register(&cros_ec_ishtp_driver, THIS_MODULE);
> @@ -791,4 +797,3 @@ MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver");
>  MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
>  
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("ishtp:*");
> -- 
> 2.33.1
> 
> 

This patch in -next as commit facfe0a4fdce ("platform/chrome:
chros_ec_ishtp: only load for matching devices") and the following one
as commit f155dfeaa4ee ("platform/x86: isthp_eclite: only load for
matching devices") break clang and GCC prior to 8.1 (output from
Debian's GCC 6.3.0 below):

$ make -skj"$(nproc)" distclean allmodconfig drivers/platform/
drivers/platform/chrome/cros_ec_ishtp.c:778:4: error: initializer element is not constant
  { cros_ish_guid },
    ^~~~~~~~~~~~~
drivers/platform/chrome/cros_ec_ishtp.c:778:4: note: (near initialization for 'cros_ec_ishtp_id_table[0].guid')
scripts/Makefile.build:288: recipe for target 'drivers/platform/chrome/cros_ec_ishtp.o' failed
make[4]: *** [drivers/platform/chrome/cros_ec_ishtp.o] Error 1
drivers/platform/x86/intel/ishtp_eclite.c:685:4: error: initializer element is not constant
  { ecl_ishtp_guid },
    ^~~~~~~~~~~~~~
drivers/platform/x86/intel/ishtp_eclite.c:685:4: note: (near initialization for 'ecl_ishtp_id_table[0].guid')

I am sure clang should be fixed to recognize this value as a compile
time constant but the kernel supports GCC back to 5.1.0 so this should
be fixed here as well.

Cheers,
Nathan

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

* [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices Nathan Chancellor
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-11  9:10               ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
                               ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: 44e2a58cb880 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
index 945a9d0b68cd..26f376faf0e6 100644
--- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
+++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
@@ -76,9 +76,9 @@ enum ish_loader_commands {
 #define LOADER_XFER_MODE_ISHTP			BIT(1)
 
 /* ISH Transport Loader client unique GUID */
-static const guid_t loader_ishtp_guid =
-	GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
-		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc);
+#define ISHTP_GUID GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7, \
+		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc)
+static const guid_t loader_ishtp_guid = ISHTP_GUID;
 
 #define FILENAME_SIZE				256
 
@@ -1064,7 +1064,7 @@ static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id loader_ishtp_id_table[] = {
-	{ loader_ishtp_guid },
+	{ ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);

base-commit: 64355db3caf6468dc711995239efe0cbcd7d0091
-- 
2.33.1


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

* [PATCH 2/4] HID: intel-ish-hid: hid-client: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: 0d0cccc0fd83 ("HID: intel-ish-hid: hid-client: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/intel-ish-hid/ishtp-hid-client.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index fb47d38d1e87..cff7da0578b6 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -12,9 +12,9 @@
 #include "ishtp-hid.h"
 
 /* ISH Transport protocol (ISHTP in short) GUID */
-static const guid_t hid_ishtp_guid =
-	GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
-		  0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26);
+#define HID_ISHTP_GUID	GUID_INIT(0x33AECD58, 0xB679, 0x4E54, \
+		  0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26)
+static const guid_t hid_ishtp_guid = HID_ISHTP_GUID;
 
 /* Rx ring buffer pool size */
 #define HID_CL_RX_RING_SIZE	32
@@ -953,7 +953,7 @@ static struct ishtp_cl_driver	hid_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id hid_ishtp_id_table[] = {
-	{ hid_ishtp_guid },
+	{ HID_ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, hid_ishtp_id_table);
-- 
2.33.1


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

* [PATCH 3/4] platform/chrome: chros_ec_ishtp: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices Nathan Chancellor
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: facfe0a4fdce ("platform/chrome: chros_ec_ishtp: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/chrome/cros_ec_ishtp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
index 8c17358e84c1..2e635fee854c 100644
--- a/drivers/platform/chrome/cros_ec_ishtp.c
+++ b/drivers/platform/chrome/cros_ec_ishtp.c
@@ -41,9 +41,9 @@ enum cros_ec_ish_channel {
 #define ISHTP_SEND_TIMEOUT			(3 * HZ)
 
 /* ISH Transport CrOS EC ISH client unique GUID */
-static const guid_t cros_ish_guid =
-	GUID_INIT(0x7b7154d0, 0x56f4, 0x4bdc,
-		  0xb0, 0xd8, 0x9e, 0x7c, 0xda,	0xe0, 0xd6, 0xa0);
+#define CROS_ISH_GUID GUID_INIT(0x7b7154d0, 0x56f4, 0x4bdc, \
+		  0xb0, 0xd8, 0x9e, 0x7c, 0xda,	0xe0, 0xd6, 0xa0)
+static const guid_t cros_ish_guid = CROS_ISH_GUID;
 
 struct header {
 	u8 channel;
@@ -775,7 +775,7 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
 };
 
 static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
-	{ cros_ish_guid },
+	{ CROS_ISH_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
-- 
2.33.1


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

* [PATCH 4/4] platform/x86: isthp_eclite: constify devicetable initializer
  2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices Nathan Chancellor
                               ` (2 preceding siblings ...)
  2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
@ 2021-11-10 23:00             ` Thomas Weißschuh
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2021-11-10 23:00 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: Thomas Weißschuh, linux-kernel, Srinivas Pandruvada,
	Rushikesh S Kadam, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, llvm

Previously the compilation broke on clang and gcc < 8.1.0 with errors like
"error: initializer element is not constant".

Fixes: f155dfeaa4ee ("platform/x86: isthp_eclite: only load for matching devices")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/platform/x86/intel/ishtp_eclite.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel/ishtp_eclite.c b/drivers/platform/x86/intel/ishtp_eclite.c
index b9fb8f28fd63..d6709d5c77fd 100644
--- a/drivers/platform/x86/intel/ishtp_eclite.c
+++ b/drivers/platform/x86/intel/ishtp_eclite.c
@@ -93,9 +93,9 @@ struct ishtp_opregion_dev {
 };
 
 /* eclite ishtp client UUID: 6a19cc4b-d760-4de3-b14d-f25ebd0fbcd9 */
-static const guid_t ecl_ishtp_guid =
-	GUID_INIT(0x6a19cc4b, 0xd760, 0x4de3,
-		  0xb1, 0x4d, 0xf2, 0x5e, 0xbd, 0xf, 0xbc, 0xd9);
+#define ECL_ISHTP_GUID GUID_INIT(0x6a19cc4b, 0xd760, 0x4de3, \
+		  0xb1, 0x4d, 0xf2, 0x5e, 0xbd, 0xf, 0xbc, 0xd9)
+static const guid_t ecl_ishtp_guid = ECL_ISHTP_GUID;
 
 /* ACPI DSM UUID: 91d936a7-1f01-49c6-a6b4-72f00ad8d8a5 */
 static const guid_t ecl_acpi_guid =
@@ -682,7 +682,7 @@ static struct ishtp_cl_driver ecl_ishtp_cl_driver = {
 };
 
 static const struct ishtp_device_id ecl_ishtp_id_table[] = {
-	{ ecl_ishtp_guid },
+	{ ECL_ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
-- 
2.33.1


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

* Re: [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer
  2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
@ 2021-11-11  9:10               ` Thomas Weißschuh
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2021-11-11  9:10 UTC (permalink / raw)
  To: Nathan Chancellor, linux-input, Jiri Kosina, Benjamin Tissoires
  Cc: linux-kernel, Srinivas Pandruvada, Rushikesh S Kadam,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, llvm,
	Arnd Bergmann

Hi,

On 2021-11-11 00:00+0100, Thomas Weißschuh wrote:
> Previously the compilation broke on clang and gcc < 8.1.0 with errors like
> "error: initializer element is not constant".
> 
> Fixes: 44e2a58cb880 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> index 945a9d0b68cd..26f376faf0e6 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
> @@ -76,9 +76,9 @@ enum ish_loader_commands {
>  #define LOADER_XFER_MODE_ISHTP			BIT(1)
>  
>  /* ISH Transport Loader client unique GUID */
> -static const guid_t loader_ishtp_guid =
> -	GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
> -		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc);
> +#define ISHTP_GUID GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7, \
> +		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc)
> +static const guid_t loader_ishtp_guid = ISHTP_GUID;
>  
>  #define FILENAME_SIZE				256
>  
> @@ -1064,7 +1064,7 @@ static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
>  };
>  
>  static const struct ishtp_device_id loader_ishtp_id_table[] = {
> -	{ loader_ishtp_guid },
> +	{ ISHTP_GUID },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);
> 
> base-commit: 64355db3caf6468dc711995239efe0cbcd7d0091
> -- 
> 2.33.1
> 

Please drop this whole series and use the patch
"HID: intel-ish-hid: fix module device-id handling"[0]
from Arnd instead.

It adds proper device table support to the ISHTP bus itself also preventing
unused-variable warnings for the device table when the drivers are built-in.

Thanks,
Thomas

[0] https://lore.kernel.org/lkml/20211111085842.2846422-1-arnd@kernel.org/

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

end of thread, other threads:[~2021-11-11  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211029152901.297939-1-linux@weissschuh.net>
     [not found] ` <20211029152901.297939-2-linux@weissschuh.net>
     [not found]   ` <20211029152901.297939-3-linux@weissschuh.net>
     [not found]     ` <20211029152901.297939-4-linux@weissschuh.net>
     [not found]       ` <20211029152901.297939-5-linux@weissschuh.net>
     [not found]         ` <20211029152901.297939-6-linux@weissschuh.net>
2021-11-10 16:44           ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices Nathan Chancellor
2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
2021-11-11  9:10               ` Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox