[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vdt22imDXu0phvbAVz=D-ctXH_JV6eMZ457e4d+=Tj0=Q@mail.gmail.com>
Date: Fri, 31 May 2013 22:44:54 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Jiri Kosina <jkosina@...e.cz>,
Dan Carpenter <dan.carpenter@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] pktcdvd: Convert printk to pr_<level>
On Thu, May 30, 2013 at 11:57 PM, Joe Perches <joe@...ches.com> wrote:
> Use a more current logging style and add messages levels
> to the logging messages.
>
> Convert bare printks to pr_cont where appropriate and
> add a simple function to emit the sense string.
Few comments below.
Why not dev_dbg wherever it's possible?
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -60,7 +62,7 @@
> #include <linux/mutex.h>
> #include <linux/slab.h>
> #include <scsi/scsi_cmnd.h>
> -l#include <scsi/scsi_ioctl.h>
> +#include <scsi/scsi_ioctl.h>
Maybe you simple could remove this typo in first patch?
> @@ -734,36 +736,37 @@ out:
> return ret;
> }
>
> +static const char *sense_key_string(__u8 index)
> +{
> + static const char *info[9] = {
> + "No sense", "Recovered error", "Not ready",
> + "Medium error", "Hardware error", "Illegal request",
> + "Unit attention", "Data protect", "Blank check"
> + };
> + if (index < 8)
> + return info[index];
> + return "INVALID";
> +}
> +
> /*
> * A generic sense dump / resolve mechanism should be implemented across
> * all ATAPI + SCSI devices.
> */
> static void pkt_dump_sense(struct packet_command *cgc)
> {
> - static char *info[9] = { "No sense", "Recovered error", "Not ready",
> - "Medium error", "Hardware error", "Illegal request",
> - "Unit attention", "Data protect", "Blank check" };
> int i;
> struct request_sense *sense = cgc->sense;
>
> - printk(DRIVER_NAME":");
> + pr_err("");
> for (i = 0; i < CDROM_PACKET_SIZE; i++)
> - printk(" %02x", cgc->cmd[i]);
> - printk(" - ");
> + pr_cont(" %02x", cgc->cmd[i]);
This one is actually %*ph.
Like: pr_info("%*ph", CDROM_PACKET_SIZE, cgc->cmd);
And what is the level of this message? debug?
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists