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:18:16 +0000	[thread overview]
Message-ID: <VI1PR0402MB34858BA974ECCBF303931CC198070@VI1PR0402MB3485.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20190517095018.7qcufwb77nu3owb4@pengutronix.de

On 5/17/2019 12:50 PM, Sascha Hauer wrote:
> On Fri, May 17, 2019 at 11:29:04AM +0200, 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.
>>
>> @@ -993,20 +978,17 @@ static void skcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
>>  	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
>>  	int ivsize = crypto_skcipher_ivsize(skcipher);
>>  
>> -#ifdef DEBUG
>> -	print_hex_dump(KERN_ERR, "dstiv  @"__stringify(__LINE__)": ",
>> +	print_hex_dump_debug("dstiv  @"__stringify(__LINE__)": ",
>>  		       DUMP_PREFIX_ADDRESS, 16, 4, req->iv,
>>  		       edesc->src_nents > 1 ? 100 : ivsize, 1);
>> -#endif
>> +
> 
> I just realized that this print_hex_dump_debug() needs to be inside if (ivsize)
> because since eaed71a44ad9 ("crypto: caam - add ecb(*) support") req->iv
> can be NULL. This is broken with or without this patch, I can include a
> patch fixing this up when doing a v2.
> 
That's true.
Since this patch set is orthogonal to the bug, IMO the fix shouldn't be part of it.

Thanks,
Horia

  reply	other threads:[~2019-05-21 14:18 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 [this message]
2019-05-21 14:31   ` Horia Geanta
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=VI1PR0402MB34858BA974ECCBF303931CC198070@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.