lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 May 2021 11:41:18 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Baokun Li <libaokun1@...wei.com>
Cc:     rafael@...nel.org, linux-kernel@...r.kernel.org,
        weiyongjun1@...wei.com, yuehaibing@...wei.com,
        yangjihong1@...wei.com, yukuai3@...wei.com
Subject: Re: [PATCH -next] driver core: Remove set but not used variable
 'no_warn'

On Thu, May 27, 2021 at 05:14:53PM +0800, Baokun Li wrote:
> 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@...wei.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
>

And now you have a build warning :(

Please always test-build your patches before sending them out.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ