[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E733EF.80003@freescale.com>
Date: Sun, 10 Aug 2014 11:57:19 +0300
From: Horia Geantă <horia.geanta@...escale.com>
To: Cristian Stoica <cristian.stoica@...escale.com>,
<linux-crypto@...r.kernel.org>
CC: <herbert@...dor.apana.org.au>, <linux-kernel@...r.kernel.org>,
<davem@...emloft.net>
Subject: Re: [PATCH 2/3] crypto: testmgr.c: white space removal on __test_skcipher
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@...escale.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists