Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1158152 > unrolled thread

Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be?

Started byRusty Russell <rusty@rustcorp.com.au>
First post2015-06-04 04:00 +0200
Last post2015-06-04 04:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be? Rusty Russell <rusty@rustcorp.com.au> - 2015-06-04 04:00 +0200

#1158152 — Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be?

FromRusty Russell <rusty@rustcorp.com.au>
Date2015-06-04 04:00 +0200
SubjectRe: kernel/params.c: 'err' variable "set but not used" and perhaps should be?
Message-ID<pxsBQ-2wB-5@gated-at.bofh.it>
Tejun Heo <htejun@gmail.com> writes:
>> > @@ -853,7 +853,8 @@ 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);
>> > +                       if (sysfs_create_file(&mk->kobj, &vattr->mattr.attr))
>> > +                               doesnt_happen();
>> >                        kobject_uevent(&mk->kobj, KOBJ_ADD);
>> >                        kobject_put(&mk->kobj);
>> >                }
>> 
>> Arguably then, the BUG_ON macro seems more appropriate for this situation
>> than this suggested doesnt_happen macro or my original offering of a call to
>> pr_warning.
>
> It does happen.  If you don't wanna roll back on failure, just wrap it
> in WARN_ON() so that there's at least some indication that something
> failed there?  It'd kinda suck to be missing some interface files w/o
> any indication, wouldn't it?

Please describe the circumstances under which this function can fail.

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web