Re: [PATCH] kernel/params.c: make use of unused but set variable

From: Tejun Heo
Date: Tue Jun 16 2015 - 15:54:15 EST


Hello, Rusty.

On Mon, Jun 15, 2015 at 05:19:26AM +0930, Rusty Russell wrote:
> Oh. Perhaps my sense of humour is miscalibrated.

Heh, prolly mine was. Sorry if I came off as aggressive.

> ===
> Subject: params: suppress unused variable error, warn once just in case code changes.
>
> It shouldn't fail due to OOM (it's boot time), and already warns if we
> get two identical names. But you never know what the future holds, and
> WARN_ON_ONCE() keeps gcc happy with minimal code.
>
> Reported-by: Louis Langholtz <lou_langholtz@xxxxxx>
> Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
>
> diff --git a/kernel/params.c b/kernel/params.c
> index 7edf31f2ce96..0b9bbdf830cb 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -884,6 +884,7 @@ static void __init version_sysfs_builtin(void)
> mk = locate_module_kobject(vattr->module_name);
> if (mk) {
> err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
> + WARN_ON_ONCE(err);
> kobject_uevent(&mk->kobj, KOBJ_ADD);

Looks good to me. Please feel free to add

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/