From 76d91af9daec9090bcfc91a5ffdcbd1ba42b0587 Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Sat, 29 Jun 2024 18:17:25 +0000 Subject: [PATCH] ANDROID: fix kernelci build breaks due to hid/uhid cyclic dependency An android-only patch to work around frozen KMI for android14 kernels allows a dependency between hid and uhid if both modules are enabled: if (IS_ENABLED(CONFIG_UHID) && parser->device->ll_driver == &uhid_hid_driver) max_buffer_size = UHID_DATA_MAX; For allmodconfig builds, both hid and uhid are modules so this creates a cyclic dependancy and we see this error in kernelci tests: ERROR: Cycle detected: hid -> uhid -> hid Fix by changeing to IS_BUILTIN() instead of IS_ENABLED() since Android builds always build uhid into the core kernel. Fixes: 7668cef28386 ("ANDROID: HID: Only utilise UHID provided exports if UHID is enabled") Signed-off-by: Todd Kjos Change-Id: I622466a42ad94e3606820cf506188bd679078cbf --- drivers/hid/hid-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f017b457f222..24c00a16276e 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -293,7 +293,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign offset = report->size; report->size += parser->global.report_size * parser->global.report_count; - if (IS_ENABLED(CONFIG_UHID) && parser->device->ll_driver == &uhid_hid_driver) + if (IS_BUILTIN(CONFIG_UHID) && parser->device->ll_driver == &uhid_hid_driver) max_buffer_size = UHID_DATA_MAX; /* Total size check: Allow for possible report index byte */ @@ -1987,7 +1987,7 @@ int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 * rsize = hid_compute_report_size(report); - if (IS_ENABLED(CONFIG_UHID) && hid->ll_driver == &uhid_hid_driver) + if (IS_BUILTIN(CONFIG_UHID) && hid->ll_driver == &uhid_hid_driver) max_buffer_size = UHID_DATA_MAX; if (report_enum->numbered && rsize >= max_buffer_size) @@ -2398,7 +2398,7 @@ int hid_hw_raw_request(struct hid_device *hdev, { unsigned int max_buffer_size = HID_MAX_BUFFER_SIZE; - if (IS_ENABLED(CONFIG_UHID) && hdev->ll_driver == &uhid_hid_driver) + if (IS_BUILTIN(CONFIG_UHID) && hdev->ll_driver == &uhid_hid_driver) max_buffer_size = UHID_DATA_MAX; if (len < 1 || len > max_buffer_size || !buf) @@ -2422,7 +2422,7 @@ int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, size_t len) { unsigned int max_buffer_size = HID_MAX_BUFFER_SIZE; - if (IS_ENABLED(CONFIG_UHID) && hdev->ll_driver == &uhid_hid_driver) + if (IS_BUILTIN(CONFIG_UHID) && hdev->ll_driver == &uhid_hid_driver) max_buffer_size = UHID_DATA_MAX; if (len < 1 || len > max_buffer_size || !buf)