yes, that would be nice, if allowed I can put my janitor hat and do that :)
> > I've also implemented helper functions for printk thats the most
> > common case, and leaved the other common case, panic, using
> > __initstr/__exitstr explicitely, so that people can comment on what is
> > better.
>
> > #define init_printk(fmt,arg...) printk(__initstr(fmt) , ##arg)
>
> I dislike init_printk; it combines variadic functions/macros with
> assumptions about how the first argument is specified (i.e. as a string
> constant), so it's potentially very confusing.
>
> Also, printk is used for debugging, and accidentally using init_printk
> instead of printk would result in no messages being printed at all if
> the driver is compiled into the kernel (while everything would work
> fine if the driver is compiled as a module, where init_printk and printk
> are identical). I think this would be very annoying to track down for
> less experienced kernel hackers.
that's why I've didn't coded a init_panic :) ok, I can change this if the
rest of the patch is considered ok
> > #define __initstr(s) ({ static char __tmp_init_str[] __initdata=s;
> > __tmp_init_str;})
>
> I think this would fail if used in structure initialisations ?
yes, this fails in such cases, any ideas on another approach that works in
this case as well in the other cases covered by the patch?
Also please note that strings in __initdata marked structs with just 'char
*' instances are going to .rodata and not getting discarded, thats why I've
changed some to char[SOME_MAX_STRING_SIZE], so that it gets moved to
.data.init, crude, but works, I'm interested in another approach for this
case as well.
Thanks for the comments.
- Arnaldo
-
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/