From: Rusty Russell Date: Tue, 16 Jun 2015 20:46:52 +0000 (+0930) Subject: params: suppress unused variable error, warn once just in case code changes. X-Git-Tag: v4.2-rc1~59^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=74c3dea355245c17ee407a3ce3ea34f55b40f2eb;p=uclinux-h8%2Flinux.git 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 Acked-by: Tejun Heo Signed-off-by: Rusty Russell --- diff --git a/kernel/params.c b/kernel/params.c index 7edf31f2ce96..e906874da5fc 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); kobject_put(&mk->kobj); }