All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android13-5.15 2/3] drivers/hid/hid-core.c:294: undefined reference to `uhid_hid_driver'
@ 2023-08-21 17:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-08-21 17:54 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android13-5.15
head:   f0fefbe055362c9a8f29ddaadf584466477b8ea0
commit: 6804500c16a5ba86b57c9976fc1491fa0efc2132 [2/3] ANDROID: HID; Over-ride default maximum buffer size when using UHID
config: x86_64-randconfig-005-20230821 (https://download.01.org/0day-ci/archive/20230822/202308220125.lF9L4BT1-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230822/202308220125.lF9L4BT1-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308220125.lF9L4BT1-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: drivers/hid/hid-core.o: in function `hid_add_field':
>> drivers/hid/hid-core.c:294: undefined reference to `uhid_hid_driver'
   ld: drivers/hid/hid-core.o: in function `hid_report_raw_event':
   drivers/hid/hid-core.c:1778: undefined reference to `uhid_hid_driver'


vim +294 drivers/hid/hid-core.c

   253	
   254	/*
   255	 * Register a new field for this report.
   256	 */
   257	
   258	static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsigned flags)
   259	{
   260		struct hid_report *report;
   261		struct hid_field *field;
   262		unsigned int max_buffer_size = HID_MAX_BUFFER_SIZE;
   263		unsigned int usages;
   264		unsigned int offset;
   265		unsigned int i;
   266		unsigned int application;
   267	
   268		application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);
   269	
   270		report = hid_register_report(parser->device, report_type,
   271					     parser->global.report_id, application);
   272		if (!report) {
   273			hid_err(parser->device, "hid_register_report failed\n");
   274			return -1;
   275		}
   276	
   277		/* Handle both signed and unsigned cases properly */
   278		if ((parser->global.logical_minimum < 0 &&
   279			parser->global.logical_maximum <
   280			parser->global.logical_minimum) ||
   281			(parser->global.logical_minimum >= 0 &&
   282			(__u32)parser->global.logical_maximum <
   283			(__u32)parser->global.logical_minimum)) {
   284			dbg_hid("logical range invalid 0x%x 0x%x\n",
   285				parser->global.logical_minimum,
   286				parser->global.logical_maximum);
   287			return -1;
   288		}
   289	
   290		offset = report->size;
   291		report->size += parser->global.report_size * parser->global.report_count;
   292	
   293		if (parser->device->ll_driver == &uhid_hid_driver)
 > 294			max_buffer_size = UHID_DATA_MAX;
   295	
   296		/* Total size check: Allow for possible report index byte */
   297		if (report->size > (max_buffer_size - 1) << 3) {
   298			hid_err(parser->device, "report is too long\n");
   299			return -1;
   300		}
   301	
   302		if (!parser->local.usage_index) /* Ignore padding fields */
   303			return 0;
   304	
   305		usages = max_t(unsigned, parser->local.usage_index,
   306					 parser->global.report_count);
   307	
   308		field = hid_register_field(report, usages);
   309		if (!field)
   310			return 0;
   311	
   312		field->physical = hid_lookup_collection(parser, HID_COLLECTION_PHYSICAL);
   313		field->logical = hid_lookup_collection(parser, HID_COLLECTION_LOGICAL);
   314		field->application = application;
   315	
   316		for (i = 0; i < usages; i++) {
   317			unsigned j = i;
   318			/* Duplicate the last usage we parsed if we have excess values */
   319			if (i >= parser->local.usage_index)
   320				j = parser->local.usage_index - 1;
   321			field->usage[i].hid = parser->local.usage[j];
   322			field->usage[i].collection_index =
   323				parser->local.collection_index[j];
   324			field->usage[i].usage_index = i;
   325			field->usage[i].resolution_multiplier = 1;
   326		}
   327	
   328		field->maxusage = usages;
   329		field->flags = flags;
   330		field->report_offset = offset;
   331		field->report_type = report_type;
   332		field->report_size = parser->global.report_size;
   333		field->report_count = parser->global.report_count;
   334		field->logical_minimum = parser->global.logical_minimum;
   335		field->logical_maximum = parser->global.logical_maximum;
   336		field->physical_minimum = parser->global.physical_minimum;
   337		field->physical_maximum = parser->global.physical_maximum;
   338		field->unit_exponent = parser->global.unit_exponent;
   339		field->unit = parser->global.unit;
   340	
   341		return 0;
   342	}
   343	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2023-08-21 17:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 17:54 [android-common:android13-5.15 2/3] drivers/hid/hid-core.c:294: undefined reference to `uhid_hid_driver' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.