On Wed, Mar 22, 2000 at 01:09:35PM +1100, Rusty Russell wrote:
> As it is, it makes it *look like* you can do:
> ================
> int init()
> {
> my_sysctl = register_sysctl_table(mytable, 0);
> if (!my_sysctl)
> return -ENOMEM;
> return 0;
> }
How about ERR_PTR() and IS_ERR()? Same idea as the cast-1-to-pointer method,
but marginally nicer. Even better, any chance of an API change so you can
err = register_sysctl_table(mytable, 0, &my_sysctl);
?
I've not looked into the code, so I don't know what it is that
register_sysctl_table returns, but is it the sort of thing that could be
a pointer to static dummy struct when the main code is disabled?
-- "So how do you feel, having given up on coffee?" "A bit slow, but you have to expect that on a Monday." "It's Thursday."- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:37 EST