Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: s5p-sss - remove unnecessary alignmask for ahashes

The crypto API's support for alignmasks for ahash algorithms is nearly
useless, as its only effect is to cause the API to align the key and
result buffers. The drivers that happen to be specifying an alignmask
for ahash rarely actually need it. When they do, it's easily fixable,
especially considering that these buffers cannot be used for DMA.

In preparation for removing alignmask support from ahash, this patch
makes the s5p-sss driver no longer use it. This driver didn't actually
rely on it; it only writes to the result buffer in
s5p_hash_copy_result(), simply using memcpy(). And this driver only
supports unkeyed hash algorithms, so the key buffer need not be
considered.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
13d13bba d39caf81

-6
-6
drivers/crypto/s5p-sss.c
··· 224 224 /* HASH HW constants */ 225 225 #define BUFLEN HASH_BLOCK_SIZE 226 226 227 - #define SSS_HASH_DMA_LEN_ALIGN 8 228 - #define SSS_HASH_DMA_ALIGN_MASK (SSS_HASH_DMA_LEN_ALIGN - 1) 229 - 230 227 #define SSS_HASH_QUEUE_LENGTH 10 231 228 232 229 /** ··· 1743 1746 CRYPTO_ALG_NEED_FALLBACK, 1744 1747 .cra_blocksize = HASH_BLOCK_SIZE, 1745 1748 .cra_ctxsize = sizeof(struct s5p_hash_ctx), 1746 - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, 1747 1749 .cra_module = THIS_MODULE, 1748 1750 .cra_init = s5p_hash_cra_init, 1749 1751 .cra_exit = s5p_hash_cra_exit, ··· 1767 1771 CRYPTO_ALG_NEED_FALLBACK, 1768 1772 .cra_blocksize = HASH_BLOCK_SIZE, 1769 1773 .cra_ctxsize = sizeof(struct s5p_hash_ctx), 1770 - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, 1771 1774 .cra_module = THIS_MODULE, 1772 1775 .cra_init = s5p_hash_cra_init, 1773 1776 .cra_exit = s5p_hash_cra_exit, ··· 1791 1796 CRYPTO_ALG_NEED_FALLBACK, 1792 1797 .cra_blocksize = HASH_BLOCK_SIZE, 1793 1798 .cra_ctxsize = sizeof(struct s5p_hash_ctx), 1794 - .cra_alignmask = SSS_HASH_DMA_ALIGN_MASK, 1795 1799 .cra_module = THIS_MODULE, 1796 1800 .cra_init = s5p_hash_cra_init, 1797 1801 .cra_exit = s5p_hash_cra_exit,