# Re: \[PATCH\] modules: add modalias file to sysfs for modules.

- From: kernel test robot \<hidden\>
- Date: 2022-11-11 20:56:31 
- List: linux-modules
- Page: https://ratatoskr.run/linux-modules/2022/11/2002901
- Thread: https://ratatoskr.run/oe-kbuild-all/2022/11/2002901/t.md

```text
Hi Allen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on driver-core/driver-core-testing]
[also build test ERROR on driver-core/driver-core-next driver-core/driver-core-linus mcgrof/modules-next usb/usb-testing usb/usb-next usb/usb-linus linus/master v6.1-rc4 next-20221111]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Allen-Webb/modules-add-modalias-file-to-sysfs-for-modules/20221111-233314
patch link:    https://lore.kernel.org/r/20221111152852.2837363-1-allenwebb%40google.com
patch subject: [PATCH] modules: add modalias file to sysfs for modules.
config: um-i386_defconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/6dda398b2e01f44f8fb5f03116ba5e6143360140
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Allen-Webb/modules-add-modalias-file-to-sysfs-for-modules/20221111-233314
        git checkout 6dda398b2e01f44f8fb5f03116ba5e6143360140
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot [ref]

All errors (new ones prefixed by >>):

   /usr/bin/ld: warning: arch/x86/um/checksum_32.o: missing .note.GNU-stack section implies executable stack
   /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
   /usr/bin/ld: warning: .tmp_vmlinux.kallsyms1 has a LOAD segment with RWX permissions
   /usr/bin/ld: drivers/base/mod_devicetable.o: in function `usb_drv_to_modalias':
>> drivers/base/mod_devicetable.c:221: undefined reference to `usb_bus_type'
>> collect2: error: ld returned 1 exit status


vim +221 drivers/base/mod_devicetable.c

   203	
   204	/* Print the modaliases for the given driver assumed to be an usb_driver or
   205	 * usb_device_driver.
   206	 *
   207	 * "alias" is prepended and the module name is appended to each modalias to
   208	 * match the format in modules.aliases.
   209	 *
   210	 * The modaliases will be written out to @buf with @count being the maximum
   211	 * bytes to write. The return value is a negative errno on error or the number
   212	 * of bytes written to @buf on success.
   213	 */
   214	ssize_t usb_drv_to_modalias(struct device_driver *drv, char *buf,
   215				    size_t count)
   216	{
   217		ssize_t len = 0;
   218		const struct usb_device_id *id;
   219		const char *mod_name;
   220	
 > 221		if (drv->bus != &usb_bus_type)

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
```

## Attachments

- [config](https://ratatoskr.run/linux-modules/2022/11/2002901/attachment/0) (text/plain, 42320 bytes)
