Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f5fa807 authored by Todd Kjos's avatar Todd Kjos
Browse files

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: default avatarTodd Kjos <tkjos@google.com>
Change-Id: I622466a42ad94e3606820cf506188bd679078cbf
parent 6aff87f4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -290,7 +290,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 */
@@ -1767,7 +1767,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,

	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)