The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Saiyam Doshi <saiyamdoshi.in@gmail.com>
Cc: linux-kernel@vger.kernel.org, adurbin@chromium.org,
	groeck@chromium.org, dlaurie@chromium.org
Subject: Re: [PATCH] gsmi: Replace printk with relevant pr_<level>
Date: Wed, 12 Jun 2019 17:10:29 +0200	[thread overview]
Message-ID: <20190612151029.GA21343@kroah.com> (raw)
In-Reply-To: <20190612142727.GA1710@ahmlpt0706>

On Wed, Jun 12, 2019 at 07:57:27PM +0530, Saiyam Doshi wrote:
> >From 3a9cec48147b24fd9d793e0fdf20058461445646 Mon Sep 17 00:00:00 2001
> From: Saiyam Doshi <saiyamdoshi.in@gmail.com>
> Date: Tue, 11 Jun 2019 19:21:50 +0530
> Subject: [PATCH] gsmi: Replace printk with relevant pr_<level>


Why is all of this in the changelog body?

Please just use 'git send-email' if you can not use a decent email
client.

> Replace printk() with pr_* macros for logging consistency.
> This also helps avoid checkpatch warnings.
> 
> Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
> ---
>  drivers/firmware/google/gsmi.c | 59 ++++++++++++++++------------------
>  1 file changed, 28 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
> index edaa4e5d84ad..e4e7f04bced8 100644
> --- a/drivers/firmware/google/gsmi.c
> +++ b/drivers/firmware/google/gsmi.c
> @@ -151,7 +151,7 @@ static struct gsmi_buf *gsmi_buf_alloc(void)
>  
>  	smibuf = kzalloc(sizeof(*smibuf), GFP_KERNEL);
>  	if (!smibuf) {
> -		printk(KERN_ERR "gsmi: out of memory\n");
> +		pr_err("gsmi: out of memory\n");

This message is not needed at all, checkpatch should have warned you
about that.

>  		return NULL;
>  	}
>  
> @@ -159,7 +159,7 @@ static struct gsmi_buf *gsmi_buf_alloc(void)
>  	smibuf->start = dma_pool_alloc(gsmi_dev.dma_pool, GFP_KERNEL,
>  				       &smibuf->handle);
>  	if (!smibuf->start) {
> -		printk(KERN_ERR "gsmi: failed to allocate name buffer\n");
> +		pr_err("gsmi: failed to allocate name buffer\n");
>  		kfree(smibuf);
>  		return NULL;
>  	}
> @@ -257,34 +257,33 @@ static int gsmi_exec(u8 func, u8 sub)
>  		rc = 1;
>  		break;
>  	case GSMI_INVALID_PARAMETER:
> -		printk(KERN_ERR "gsmi: exec 0x%04x: Invalid parameter\n", cmd);
> +		pr_err("gsmi: exec 0x%04x: Invalid parameter\n", cmd);

why not dev_err() for all of these?  It's a driver, you should have a
device, use it so that the user has a chance to know what device is
acting up.

thanks,

greg k-h

  reply	other threads:[~2019-06-12 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 14:27 [PATCH] gsmi: Replace printk with relevant pr_<level> Saiyam Doshi
2019-06-12 15:10 ` Greg KH [this message]
2019-06-12 15:14 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190612151029.GA21343@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adurbin@chromium.org \
    --cc=dlaurie@chromium.org \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saiyamdoshi.in@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox