Skip to content
Permalink
Browse files
base: remove unused variable 'no_warn'
Fix the following build warning:

  drivers/base/module.c:36:6: error: variable 'no_warn' set but not used [-Werror,-Wunused-but-set-variable]
        int no_warn;

Signed-off-by: Bill Wendling <morbo@google.com>
  • Loading branch information
gwelymernans authored and intel-lab-lkp committed Jul 14, 2021
1 parent 4e65a83 commit f6c4b007fc8c907719d883faae424f2cf3bb100c
Showing 1 changed file with 2 additions and 4 deletions.
@@ -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,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,
driver_name);
sysfs_create_link(mk->drivers_dir, &drv->p->kobj, driver_name);
kfree(driver_name);
}
}

0 comments on commit f6c4b00

Please sign in to comment.