Re: [patch] kernel sysfs events layer

From: Greg KH
Date: Sat Sep 11 2004 - 13:18:32 EST


On Sat, Sep 11, 2004 at 12:35:25PM +0100, Dave Jones wrote:
> On Fri, Sep 10, 2004 at 05:48:27PM -0700, Greg KH wrote:
>
> > > What happened to a formatted string argument? The signal argument can
> > > become the pre-formatted string, and someone can provide a wrapper
> > > that takes a printf() like format and args.
> > > kobject_uevent_printf(kobj, "something bad: 0x%08x", err);
> >
> > Use an attribute, and have userspace read that formatted argument if
> > need be. This keeps the kernel interface much simpler, and doesn't
> > allow you to abuse it for things it is not intended for (like error
> > reporting stuff...)
>
> Erm, no. This will just encourage folks to sprintf to a buffer first
> and pass the result to kobject_uevent_printf().

Yeah, I agree. I think we need to standardize on the "events", and make
it hard to misspell them. I'll work on that on Monday.

> nitpick: Also, if this isn't taking formatted input, shouldn't the name of the
> function lose the 'f' ?

The function name is kobject_uevent(), no 'f' in sight :)

thanks,

greg k-h
-
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/