All of lore.kernel.org
 help / color / mirror / Atom feed
From: Horia Geanta <horia.geanta@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [PATCH 2/3] crypto: caam: print debug messages at debug level
Date: Tue, 21 May 2019 14:31:23 +0000	[thread overview]
Message-ID: <VI1PR0402MB3485594CF5ECFD6F08AF7FA298070@VI1PR0402MB3485.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20190517092905.1264-3-s.hauer@pengutronix.de

On 5/17/2019 12:29 PM, Sascha Hauer wrote:
> The CAAM driver used to put its debug messages inside #ifdef DEBUG and
> then prints the messages at KERN_ERR level. Replace this with proper
> functions printing at KERN_DEBUG level. The #ifdef DEBUG gets
> unnecessary when the right functions are used.
> 
> This replaces:
> 
> - print_hex_dump(KERN_ERR ...) inside #ifdef DEBUG with
>   print_hex_dump_debug(...)
> - dev_err() inside #ifdef DEBUG with dev_dbg()
> - printk(KERN_ERR ...) inside #ifdef DEBUG with dev_dbg()
> 
> Some parts of the driver use these functions already, so it is only
> consequent to use the debug function consistently.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/crypto/caam/caamalg.c      |  95 ++++++++--------------
>  drivers/crypto/caam/caamalg_desc.c |  71 ++++------------
>  drivers/crypto/caam/caamalg_qi.c   |  36 +++------
>  drivers/crypto/caam/caamhash.c     | 126 +++++++++--------------------
>  drivers/crypto/caam/caamrng.c      |  16 ++--
>  drivers/crypto/caam/key_gen.c      |  19 ++---
>  drivers/crypto/caam/sg_sw_sec4.h   |   5 +-
>  7 files changed, 113 insertions(+), 255 deletions(-)
> 
> diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
> index 007c35cfc670..1395b4860f23 100644
> --- a/drivers/crypto/caam/caamalg.c
> +++ b/drivers/crypto/caam/caamalg.c
> @@ -575,13 +575,11 @@ static int aead_setkey(struct crypto_aead *aead,
>  	if (crypto_authenc_extractkeys(&keys, key, keylen) != 0)
>  		goto badkey;
>  
> -#ifdef DEBUG
> -	printk(KERN_ERR "keylen %d enckeylen %d authkeylen %d\n",
> +	dev_dbg(jrdev, "keylen %d enckeylen %d authkeylen %d\n",
>  	       keys.authkeylen + keys.enckeylen, keys.enckeylen,
>  	       keys.authkeylen);
> -	print_hex_dump(KERN_ERR, "key in @"__stringify(__LINE__)": ",
> +	print_hex_dump_debug("key in @"__stringify(__LINE__)": ",
>  		       DUMP_PREFIX_ADDRESS, 16, 4, key, keylen, 1);
The alignments should probably be taken care of too, even if it adds a bit of noise.

Thanks,
Horia

  parent reply	other threads:[~2019-05-21 14:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  9:29 [PATCH 0/3] crypto: CAAM: Print debug messages at debug level Sascha Hauer
2019-05-17  9:29 ` [PATCH 1/3] crypto: caam: remove unused defines Sascha Hauer
2019-05-21 14:23   ` Horia Geanta
2019-05-17  9:29 ` [PATCH 2/3] crypto: caam: print debug messages at debug level Sascha Hauer
2019-05-17  9:50   ` Sascha Hauer
2019-05-21 14:18     ` Horia Geanta
2019-05-21 14:31   ` Horia Geanta [this message]
2019-05-17  9:29 ` [PATCH 3/3] crypto: caam: print messages in caam_dump_sg " Sascha Hauer
2019-05-21 14:33   ` Horia Geanta

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=VI1PR0402MB3485594CF5ECFD6F08AF7FA298070@VI1PR0402MB3485.eurprd04.prod.outlook.com \
    --to=horia.geanta@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.