From: kernel test robot <lkp@intel.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>,
gregkh@linuxfoundation.org, rafael@kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-kernel@vger.kernel.org,
Zheng Yongjun <zhengyongjun3@huawei.com>
Subject: Re: [PATCH] drivers: modules: remove set but not used variable 'no_warn'
Date: Sat, 25 Jul 2020 03:09:15 +0800 [thread overview]
Message-ID: <202007250351.WM740uay%lkp@intel.com> (raw)
In-Reply-To: <20200721084144.13545-1-zhengyongjun3@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 3293 bytes --]
Hi Zheng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on driver-core/driver-core-testing]
[also build test WARNING on staging/staging-testing linux/master linus/master v5.8-rc6 next-20200724]
[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]
url: https://github.com/0day-ci/linux/commits/Zheng-Yongjun/drivers-modules-remove-set-but-not-used-variable-no_warn/20200721-164445
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 6bdb486c5a628f7a927c2658166e3a5ef1f883e7
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project e0ee2288424952e0445f096ae7800472eac11249)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/base/module.c:61:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
^~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/module.c:65:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
^~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
vim +/warn_unused_result +61 drivers/base/module.c
32
33 void module_add_driver(struct module *mod, struct device_driver *drv)
34 {
35 char *driver_name;
36 struct module_kobject *mk = NULL;
37
38 if (!drv)
39 return;
40
41 if (mod)
42 mk = &mod->mkobj;
43 else if (drv->mod_name) {
44 struct kobject *mkobj;
45
46 /* Lookup built-in module entry in /sys/modules */
47 mkobj = kset_find_obj(module_kset, drv->mod_name);
48 if (mkobj) {
49 mk = container_of(mkobj, struct module_kobject, kobj);
50 /* remember our module structure */
51 drv->p->mkobj = mk;
52 /* kset_find_obj took a reference */
53 kobject_put(mkobj);
54 }
55 }
56
57 if (!mk)
58 return;
59
60 /* Don't check return codes; these calls are idempotent */
> 61 sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
62 driver_name = make_driver_name(drv);
63 if (driver_name) {
64 module_create_drivers_dir(mk);
65 sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
66 driver_name);
67 kfree(driver_name);
68 }
69 }
70
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 75331 bytes --]
prev parent reply other threads:[~2020-07-24 19:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 8:41 Zheng Yongjun
2020-07-21 8:53 ` Greg KH
2020-07-24 19:09 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202007250351.WM740uay%lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=zhengyongjun3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome