linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/crypto: remove redundant update of data
@ 2014-08-24 20:38 Colin King
  2014-08-25  7:04 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2014-08-24 20:38 UTC (permalink / raw)
  To: Herbert Xu, davem, Catalin Marinas, Will Deacon, linux-crypto,
	linux-arm-kernel
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Originally found by cppcheck:

[arch/arm64/crypto/sha2-ce-glue.c:153]: (warning) Assignment of
  function parameter has no effect outside the function. Did you
  forget dereferencing it?

Updating data by blocks * SHA256_BLOCK_SIZE at the end of
ha2_finup is redundant code and can be removed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 arch/arm64/crypto/sha2-ce-glue.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
index c294e67..ae67e88 100644
--- a/arch/arm64/crypto/sha2-ce-glue.c
+++ b/arch/arm64/crypto/sha2-ce-glue.c
@@ -150,7 +150,6 @@ static void sha2_finup(struct shash_desc *desc, const u8 *data,
 	kernel_neon_begin_partial(28);
 	sha2_ce_transform(blocks, data, sctx->state, NULL, len);
 	kernel_neon_end();
-	data += blocks * SHA256_BLOCK_SIZE;
 }
 
 static int sha224_finup(struct shash_desc *desc, const u8 *data,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64/crypto: remove redundant update of data
  2014-08-24 20:38 [PATCH] arm64/crypto: remove redundant update of data Colin King
@ 2014-08-25  7:04 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2014-08-25  7:04 UTC (permalink / raw)
  To: Colin King
  Cc: Herbert Xu, David S. Miller, Catalin Marinas, Will Deacon,
	linux-crypto, linux-arm-kernel, linux-kernel

On 24 August 2014 22:38, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Originally found by cppcheck:
>
> [arch/arm64/crypto/sha2-ce-glue.c:153]: (warning) Assignment of
>   function parameter has no effect outside the function. Did you
>   forget dereferencing it?
>
> Updating data by blocks * SHA256_BLOCK_SIZE at the end of
> ha2_finup is redundant code and can be removed.
>

^^^ typo here

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


> ---
>  arch/arm64/crypto/sha2-ce-glue.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
> index c294e67..ae67e88 100644
> --- a/arch/arm64/crypto/sha2-ce-glue.c
> +++ b/arch/arm64/crypto/sha2-ce-glue.c
> @@ -150,7 +150,6 @@ static void sha2_finup(struct shash_desc *desc, const u8 *data,
>         kernel_neon_begin_partial(28);
>         sha2_ce_transform(blocks, data, sctx->state, NULL, len);
>         kernel_neon_end();
> -       data += blocks * SHA256_BLOCK_SIZE;
>  }
>
>  static int sha224_finup(struct shash_desc *desc, const u8 *data,
> --
> 2.1.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-25  7:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-24 20:38 [PATCH] arm64/crypto: remove redundant update of data Colin King
2014-08-25  7:04 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).