linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] HID: intel-ish-hid: fw-loader: Fix build error
@ 2021-11-11 13:56 YueHaibing
  0 siblings, 0 replies; only message in thread
From: YueHaibing @ 2021-11-11 13:56 UTC (permalink / raw)
  To: srinivas.pandruvada, jikos, benjamin.tissoires, hdegoede, linux
  Cc: linux-input, linux-kernel, YueHaibing

drivers/hid/intel-ish-hid/ishtp-fw-loader.c:1067:4: error: initializer element is not constant
  { loader_ishtp_guid },
    ^~~~~~~~~~~~~~~~~

The reason is that we are using non-const expressions to initialize the
static structure, which will probably trigger a compiling error/warning
on gcc-7.5.0. Fix it by converting const variable into macro.

Fixes: 44e2a58cb880 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 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..98657b3bfd3f 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 LOADER_ISHTP_GUID \
+	GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7, \
+		  0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc)
 
 #define FILENAME_SIZE				256
 
@@ -880,7 +880,7 @@ static int loader_init(struct ishtp_cl *loader_ishtp_cl, int reset)
 
 	fw_client =
 		ishtp_fw_cl_get_client(ishtp_get_ishtp_device(loader_ishtp_cl),
-				       &loader_ishtp_guid);
+				       &LOADER_ISHTP_GUID);
 	if (!fw_client) {
 		dev_err(cl_data_to_dev(client_data),
 			"ISH client uuid not found\n");
@@ -1057,14 +1057,14 @@ static int loader_ishtp_cl_reset(struct ishtp_cl_device *cl_device)
 
 static struct ishtp_cl_driver	loader_ishtp_cl_driver = {
 	.name = "ish-loader",
-	.guid = &loader_ishtp_guid,
+	.guid = &LOADER_ISHTP_GUID,
 	.probe = loader_ishtp_cl_probe,
 	.remove = loader_ishtp_cl_remove,
 	.reset = loader_ishtp_cl_reset,
 };
 
 static const struct ishtp_device_id loader_ishtp_id_table[] = {
-	{ loader_ishtp_guid },
+	{ LOADER_ISHTP_GUID },
 	{ }
 };
 MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-11 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 13:56 [PATCH -next] HID: intel-ish-hid: fw-loader: Fix build error YueHaibing

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).