[PATCH -next] HID: intel-ish-hid: hid-client: Fix build error

From: YueHaibing
Date: Thu Nov 11 2021 - 08:56:07 EST


drivers/hid/intel-ish-hid/ishtp-hid-client.c:956:4: error: initializer element is not constant
{ hid_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: 0d0cccc0fd83 ("HID: intel-ish-hid: hid-client: only load for matching devices")
Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
drivers/hid/intel-ish-hid/ishtp-hid-client.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 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..545ec6cf345c 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)

/* Rx ring buffer pool size */
#define HID_CL_RX_RING_SIZE 32
@@ -662,7 +662,7 @@ static int hid_ishtp_cl_init(struct ishtp_cl *hid_ishtp_cl, int reset)
ishtp_set_tx_ring_size(hid_ishtp_cl, HID_CL_TX_RING_SIZE);
ishtp_set_rx_ring_size(hid_ishtp_cl, HID_CL_RX_RING_SIZE);

- fw_client = ishtp_fw_cl_get_client(dev, &hid_ishtp_guid);
+ fw_client = ishtp_fw_cl_get_client(dev, &HID_ISHTP_GUID);
if (!fw_client) {
dev_err(cl_data_to_dev(client_data),
"ish client uuid not found\n");
@@ -945,7 +945,7 @@ static const struct dev_pm_ops hid_ishtp_pm_ops = {

static struct ishtp_cl_driver hid_ishtp_cl_driver = {
.name = "ish-hid",
- .guid = &hid_ishtp_guid,
+ .guid = &HID_ISHTP_GUID,
.probe = hid_ishtp_cl_probe,
.remove = hid_ishtp_cl_remove,
.reset = hid_ishtp_cl_reset,
@@ -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.17.1