[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200721084144.13545-1-zhengyongjun3@huawei.com>
Date: Tue, 21 Jul 2020 16:41:44 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <gregkh@...uxfoundation.org>, <rafael@...nel.org>
CC: <linux-kernel@...r.kernel.org>,
Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH] drivers: modules: remove set but not used variable 'no_warn'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/base/module.c: In function 'module_add_driver':
drivers/base/module.c:33: warning:
variable 'no_warn' set but not used [-Wunused-but-set-variable]
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
drivers/base/module.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/base/module.c b/drivers/base/module.c
index 46ad4d636731..d1060c504c1b 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -33,7 +33,6 @@ static void module_create_drivers_dir(struct module_kobject *mk)
void module_add_driver(struct module *mod, struct device_driver *drv)
{
char *driver_name;
- int no_warn;
struct module_kobject *mk = NULL;
if (!drv)
@@ -59,11 +58,11 @@ void module_add_driver(struct module *mod, struct device_driver *drv)
return;
/* Don't check return codes; these calls are idempotent */
- no_warn = sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
+ sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
driver_name = make_driver_name(drv);
if (driver_name) {
module_create_drivers_dir(mk);
- no_warn = sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
+ sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
driver_name);
kfree(driver_name);
}
--
2.17.1
Powered by blists - more mailing lists