[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b710f6d-05cf-49d5-b004-849ee2a3ca42@kadam.mountain>
Date: Thu, 7 Sep 2023 13:49:43 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Su Hui <suhui@...china.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] driver base: slience unused warning
On Thu, Aug 31, 2023 at 03:36:55PM +0800, Su Hui wrote:
> Avoid unused warning with gcc and W=1 option.
>
> drivers/base/module.c:36:6: error:
> variable ‘no_warn’ set but not used [-Werror=unused-but-set-variable]
>
> Signed-off-by: Su Hui <suhui@...china.com>
> ---
> drivers/base/module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/module.c b/drivers/base/module.c
> index 46ad4d636731..10494336d601 100644
> --- a/drivers/base/module.c
> +++ b/drivers/base/module.c
> @@ -33,7 +33,7 @@ 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;
> + int __maybe_unused no_warn;
Just delete the variable if it isn't used.
regards,
dan carpenter
Powered by blists - more mailing lists