Re: [PATCH] acpi: fan.c: printk replacement

From: Joe Perches
Date: Tue Aug 26 2014 - 16:59:13 EST


On Tue, 2014-08-26 at 23:02 +0200, Rafael J. Wysocki wrote:
> On Tuesday, August 26, 2014 09:00:39 PM Sudip Mukherjee wrote:
> > On Tue, Aug 26, 2014 at 12:45:20AM +0200, Rafael J. Wysocki wrote:
> > > On Friday, August 22, 2014 05:33:21 PM Sudip Mukherjee wrote:
> > > > printk replaced with corresponding dev_err and dev_info
> > > > fixed one broken user-visible string
> > > > multiine comment edited for correct commenting style
> > > > asm/uaccess.h replaced with linux/uaccess.h
> > > >
> > > > Signed-off-by: Sudip Mukherjee <sudip@xxxxxxxxxxxxxxx>
> > > > ---
> > > > drivers/acpi/fan.c | 18 +++++++++---------
> > > > 1 file changed, 9 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
> > > > index 8acf53e..7900d55 100644
> > > > --- a/drivers/acpi/fan.c
> > > > +++ b/drivers/acpi/fan.c
> > > > @@ -27,7 +27,7 @@
> > > > #include <linux/module.h>
> > > > #include <linux/init.h>
> > > > #include <linux/types.h>
> > > > -#include <asm/uaccess.h>
> > > > +#include <linux/uaccess.h>
> > > > #include <linux/thermal.h>
> > > > #include <linux/acpi.h>
> > > >
> > > > @@ -127,8 +127,9 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
> > > > };
> > > >
> > > > /* --------------------------------------------------------------------------
> > > > - Driver Interface
> > > > - -------------------------------------------------------------------------- */
> > > > + * Driver Interface
> > > > + * --------------------------------------------------------------------------
> > > > +*/
> > > >
> > > > static int acpi_fan_add(struct acpi_device *device)
> > > > {
> > > > @@ -143,7 +144,7 @@ static int acpi_fan_add(struct acpi_device *device)
> > > >
> > > > result = acpi_bus_update_power(device->handle, NULL);
> > > > if (result) {
> > > > - printk(KERN_ERR PREFIX "Setting initial power state\n");
> > > > + dev_err(&device->dev, PREFIX "Setting initial power state\n");
> > >
> > > While at it, please define a proper pr_fmt() for this file and get rid of PREFIX
> > > too.
> > >
> > > Otherwise I don't see a compelling reason to apply this.
> > >
> >
> > Hi,
> > Since in the patch I am not using any pr_* , so I am unable to understand why
> > you are asking for a proper pr_fmt().
>
> Never mind, I was confused somehow, not exactly sure why. Sorry about that.
>
> > I can get rid of the PREFIX . Then should I use pr_* in the patch instead of dev_* ?
> > My understanding was dev_* is more preffered than pr_*.
> > waiting for your suggestion on this.
>
> Well, that really depends on the particular case. It really is better to use
> dev_err() here, but then PREFIX with it is not really useful, so please just
> drop PREFIX from the new messages.

PREFIX is "ACPI: " so I think the idea is
to be able to grep for that.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/