summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp
diff options
context:
space:
mode:
authorGary R Hook2017-03-28 17:57:26 +0200
committerHerbert Xu2017-04-05 15:58:35 +0200
commit2d158391061ec8c73898ceac148f4eddfa83efd5 (patch)
tree3e8c9c3c8af547b1020949ed23019fddc3c58e6f /drivers/crypto/ccp
parentcrypto: ccp - Remove redundant cpu-to-le32 macros (diff)
downloadkernel-qcow2-linux-2d158391061ec8c73898ceac148f4eddfa83efd5.tar.gz
kernel-qcow2-linux-2d158391061ec8c73898ceac148f4eddfa83efd5.tar.xz
kernel-qcow2-linux-2d158391061ec8c73898ceac148f4eddfa83efd5.zip
crypto: ccp - Rearrange structure members to minimize size
The AES GCM function (in ccp-ops) requires a fair amount of stack space, which elicits a complaint when KASAN is enabled. Rearranging and packing a few structures eliminates the warning. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp')
-rw-r--r--drivers/crypto/ccp/ccp-dev.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h
index 3a45c2af2fbd..191274d41036 100644
--- a/drivers/crypto/ccp/ccp-dev.h
+++ b/drivers/crypto/ccp/ccp-dev.h
@@ -427,33 +427,33 @@ enum ccp_memtype {
};
#define CCP_MEMTYPE_LSB CCP_MEMTYPE_KSB
+
struct ccp_dma_info {
dma_addr_t address;
unsigned int offset;
unsigned int length;
enum dma_data_direction dir;
-};
+} __packed __aligned(4);
struct ccp_dm_workarea {
struct device *dev;
struct dma_pool *dma_pool;
- unsigned int length;
u8 *address;
struct ccp_dma_info dma;
+ unsigned int length;
};
struct ccp_sg_workarea {
struct scatterlist *sg;
int nents;
+ unsigned int sg_used;
struct scatterlist *dma_sg;
struct device *dma_dev;
unsigned int dma_count;
enum dma_data_direction dma_dir;
- unsigned int sg_used;
-
u64 bytes_left;
};