lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190612151029.GA21343@kroah.com>
Date:   Wed, 12 Jun 2019 17:10:29 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Saiyam Doshi <saiyamdoshi.in@...il.com>
Cc:     linux-kernel@...r.kernel.org, adurbin@...omium.org,
        groeck@...omium.org, dlaurie@...omium.org
Subject: Re: [PATCH] gsmi: Replace printk with relevant pr_<level>

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@...il.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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ