public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] driver core: Remove set but not used variable 'no_warn'
@ 2021-05-27  9:14 Baokun Li
  2021-05-27  9:41 ` Greg KH
  2021-05-27 10:11 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Baokun Li @ 2021-05-27  9:14 UTC (permalink / raw)
  To: gregkh, rafael, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/base/module.c: In function 'module_create_drivers_dir':
drivers/base/module.c:36:6: warning:
 variable ‘no_warn’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 drivers/base/module.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/base/module.c b/drivers/base/module.c
index 46ad4d636731..07ecd66b12b0 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,12 +58,12 @@ 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,
-					    driver_name);
+		sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
+				  driver_name);
 		kfree(driver_name);
 	}
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-27 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-27  9:14 [PATCH -next] driver core: Remove set but not used variable 'no_warn' Baokun Li
2021-05-27  9:41 ` Greg KH
2021-05-27 10:11 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox