Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_

Jean Delvare
2010-10-20T07:42:23Z

Hi Joe,

On Tue, 19 Oct 2010 16:13:40 -0700, Joe Perches wrote:
> Convert printks to pr_<level>
> Coalesce long formats
> Removed prefixes from formats
> Added #define pr_fmt KBUILD_MODNAME ": " fmt
> Standardized abitguru messages for reporting and finding MAINTAINER
> (...)
> diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
> index 03694cc..8f07a9d 100644
> --- a/drivers/hwmon/abituguru.c
> +++ b/drivers/hwmon/abituguru.c
> @@ -20,6 +20,9 @@
> the custom Abit uGuru chip found on Abit uGuru motherboards. Note: because
> of lack of specs the CPU/RAM voltage & frequency control is not supported!
> */
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/module.h>

It looks odd that every driver would have to set this. Shouldn't this
be the default set in <linux/kernel.h>? Something like:

#ifndef pr_fmt
#ifdef KBUILD_MODNAME
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#else
#define pr_fmt(fmt) fmt
#endif /* KBUILD_MODNAME */
#endif

Overall I like this cleanup patch, but the addition of #define pr_fmt
to every driver looks plain wrong.

I'll review the rest of the patch(es) once this point is sorted out.

--
Jean Delvare