2009-07-24 07:28:01

by Herbert Xu

[permalink] [raw]
Subject: crypto: api - Fix aligned ctx helper

commit ab300465676b0c0559af62d57ec9a902f5680b03
Author: Herbert Xu <[email protected]>
Date: Fri Jul 24 15:26:15 2009 +0800

crypto: api - Fix aligned ctx helper

The aligned ctx helper was using a bogus alignment value thas was
one off the correct value. Fortunately the current users do not
require anything beyond the natural alignment of the platform so
this hasn't caused a problem.

This patch fixes that and also removes the unnecessary minimum
check since if the alignment is less than the natural alignment
then the subsequent ALIGN operation should be a noop.

Signed-off-by: Herbert Xu <[email protected]>

diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 9de6c38..3f38814 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -175,12 +175,8 @@ int blkcipher_walk_virt_block(struct blkcipher_desc *desc,

static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm)
{
- unsigned long addr = (unsigned long)crypto_tfm_ctx(tfm);
- unsigned long align = crypto_tfm_alg_alignmask(tfm);