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

Jim Cromie
2010-10-20T20:36:49Z

On Wed, Oct 20, 2010 at 1:59 PM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2010-10-20 at 12:52 -0700, Joe Perches wrote:
>> So perhaps add this to include/linux/hwmon.h instead:
>> #if defined pr_fmt
>> #undef pr_fmt
>> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>> #endif
>
> Nope.  That won't work as other non-hwmon files include it.
>
> drivers/platform/x86/eeepc-laptop.c:#include <linux/hwmon.h>
> drivers/platform/x86/compal-laptop.c:#include <linux/hwmon.h>
> drivers/platform/x86/thinkpad_acpi.c:#include <linux/hwmon.h>
> drivers/thermal/thermal_sys.c:#include <linux/hwmon.h>
> drivers/staging/iio/light/tsl2563.c:#include <linux/hwmon.h>
> drivers/gpu/drm/radeon/radeon_pm.c:#include <linux/hwmon.h>
> drivers/gpu/drm/nouveau/nouveau_pm.c:#include <linux/hwmon.h>
> drivers/acpi/power_meter.c:#include <linux/hwmon.h>
> drivers/input/touchscreen/ads7846.c:#include <linux/hwmon.h>
>
>
>

what about modules.h ? or device.h ?

Id think that would cover many users without being universally inadequate,
and Id guess one of those (or a neighbor) would cover most of the use-cases.

youve got a list of 200 pr-fmt users,
why not break them down by which format theyre using,
and see if those formats line up with subsystems.
Id think 6 or 7 definitions in the appropriate headers
would give useful log-content, and avoid countless changes.

KBUILD_MODNAME is always #defined by the make system.
so if your defn built upon that, it would address all code that builds
as modules, how many other use-cases are there ?