[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061215154751.86a2dbdd.khali@linux-fr.org>
Date: Fri, 15 Dec 2006 15:47:51 +0100
From: Jean Delvare <khali@...ux-fr.org>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Andrew Morton <akpm@...l.org>,
Olivier Galibert <galibert@...ox.com>,
Paul Mackerras <paulus@...ba.org>,
Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: sysfs file creation result nightmare
Ben,
On Sun, 10 Dec 2006 11:55:31 +1100, Benjamin Herrenschmidt wrote:
> > And (ultimately) make the function return void.
> >
> > Yes, that's probably a valid approach - we've discussed it before but nobody has
> > taken it further.
>
> I would have preferred that approach (with a WARN_ON rather than a BUG
> though). On the other hand that would make it slightly harder for the
> few cases (if any ?) who actually want something like a "create if it
> doesn't exist already" semantic.
Let's just boldly state that nobody wants that semantic, if it helps.
> I'm a bit worried by the amount of code added by systematic checking of
> the results for cases that really should never happen. That's why I
> prefer a BUG/WARN type semantic.
>
> Maybe the best is to have the examples like radeonfb actually do the
>
> WARN_ON(sysfs_create_file(...));
Beware that sysfs_remove_bin_file() will complain loudly if you later
attempt to delete that file that was never created.
--
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists