All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@freescale.com>
To: Cristian Stoica <cristian.stoica@freescale.com>,
	<linux-crypto@vger.kernel.org>
Cc: <herbert@gondor.apana.org.au>, <linux-kernel@vger.kernel.org>,
	<davem@davemloft.net>
Subject: Re: [PATCH 2/3] crypto: testmgr.c: white space removal on __test_skcipher
Date: Sun, 10 Aug 2014 11:57:19 +0300	[thread overview]
Message-ID: <53E733EF.80003@freescale.com> (raw)
In-Reply-To: <1407497272-9161-2-git-send-email-cristian.stoica@freescale.com>

On 8/8/2014 2:27 PM, Cristian Stoica wrote:
> This patch inverts two if conditions to remove code blocks
> indentation. Several white space clean-ups follow.
> 
> Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
> ---
>  crypto/testmgr.c | 283 ++++++++++++++++++++++++++-----------------------------
>  1 file changed, 136 insertions(+), 147 deletions(-)

Don't add more checkpatch warnings on top of existing ones.

> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index 51f47f2..36f45ff 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -974,73 +974,69 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
>  		else
>  			memset(iv, 0, MAX_IVLEN);
>  
> -		if (!(template[i].np) || (template[i].also_non_np)) {
> -			j++;
> +		if (template[i].np && !template[i].also_non_np)
> +			continue;
>  
> -			ret = -EINVAL;
> -			if (WARN_ON(align_offset + template[i].ilen >
> -				    PAGE_SIZE))
> -				goto out;
> +		j++;
>  
> -			data = xbuf[0];
> -			data += align_offset;
> -			memcpy(data, template[i].input, template[i].ilen);
> +		ret = -EINVAL;
> +		if (WARN_ON(align_offset + template[i].ilen > PAGE_SIZE))
> +			goto out;
>  
> -			crypto_ablkcipher_clear_flags(tfm, ~0);
> -			if (template[i].wk)
> -				crypto_ablkcipher_set_flags(
> -					tfm, CRYPTO_TFM_REQ_WEAK_KEY);
> +		data = xbuf[0];
> +		data += align_offset;
> +		memcpy(data, template[i].input, template[i].ilen);
>  
> -			ret = crypto_ablkcipher_setkey(tfm, template[i].key,
> -						       template[i].klen);
> -			if (!ret == template[i].fail) {
> -				pr_err("alg: skcipher%s: setkey failed on test %d for %s: flags=%x\n",
> -				       d, j, algo,
> -				       crypto_ablkcipher_get_flags(tfm));
> -				goto out;
> -			} else if (ret)
> -				continue;
> +		crypto_ablkcipher_clear_flags(tfm, ~0);
> +		if (template[i].wk)

WARNING: line over 80 characters
#58: FILE: crypto/testmgr.c:992:

> +			crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_REQ_WEAK_KEY);

[...]

> @@ -1055,116 +1051,109 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
>  		else
>  			memset(iv, 0, MAX_IVLEN);
>  
> -		if (template[i].np) {
> -			j++;
> +		if (!template[i].np)
> +			continue;
>  
> -			crypto_ablkcipher_clear_flags(tfm, ~0);
> -			if (template[i].wk)
> -				crypto_ablkcipher_set_flags(
> -					tfm, CRYPTO_TFM_REQ_WEAK_KEY);
> +		j++;
>  
> -			ret = crypto_ablkcipher_setkey(tfm, template[i].key,
> -						       template[i].klen);
> -			if (!ret == template[i].fail) {
> -				pr_err("alg: skcipher%s: setkey failed on chunk test %d for %s: flags=%x\n",
> -				       d, j, algo,
> -				       crypto_ablkcipher_get_flags(tfm));
> -				goto out;
> -			} else if (ret)
> -				continue;
> +		crypto_ablkcipher_clear_flags(tfm, ~0);
> +		if (template[i].wk)

WARNING: line over 80 characters
#170: FILE: crypto/testmgr.c:1061:

> +			crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_REQ_WEAK_KEY);

Thanks,
Horia

  reply	other threads:[~2014-08-10  8:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 10:11 [PATCH] crypto: testmgr.c: white space fix-ups on test_aead Cristian Stoica
2014-08-08  9:22 ` Horia Geantă
2014-08-08 11:27   ` [PATCH 1/3] crypto: testmgr.c: white space removal on __test_hash Cristian Stoica
2014-08-08 11:27     ` [PATCH 2/3] crypto: testmgr.c: white space removal on __test_skcipher Cristian Stoica
2014-08-10  8:57       ` Horia Geantă [this message]
2014-08-11  6:33         ` Cristian Stoica
2014-08-08 11:27     ` [PATCH 3/3] crypto: testmgr.c: delay execution of set-up code Cristian Stoica
2014-08-25 12:40 ` [PATCH] crypto: testmgr.c: white space fix-ups on test_aead Herbert Xu

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=53E733EF.80003@freescale.com \
    --to=horia.geanta@freescale.com \
    --cc=cristian.stoica@freescale.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.