On Wednesday 24 August 2011, Joe Perches wrote:
> It might be reasonable to have slim specific macros/functions
> for message logging. That might allow slim specific prefixes.
>
> For functions, you could look at netdev_<level>:
>
> slim_<level>(struct slim_controller *ctrl, const char *fmt, ...)
>
> or macros like:
>
> #define slim_printk(level, ctrl, fmt, ...) \
> dev_printk(level, &(ctrl)->dev, fmt, ##__VA_ARGS__)
> #define slim_<level>(level, ctrl, fmt, ...) \
> slim_printk(KERN_<LEVEL>, ctrl, fmt, ##__VA_ARGS__)
> etc.
Hi Joe,
My recommendation is always against such macros, and for using the
dev_* and pr_* macros directly. The reason is mostly so that a
causal reader with a kernel background can immediately understand
what they do, rather than having to look up extra macro definition,
e.g. to see if they add the newline character or not.
I agree with all your other comments though, thanks for taking
a look as well.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html