aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/hisilicon
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-06-06 09:57:13 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-13 14:31:41 +0800
commit1793d1aba1941573ba9ebf75dfbb11a8c2b943b1 (patch)
treef5fb556a4e5e654b39d79781c788494b069e4ca2 /drivers/crypto/hisilicon
parentARM: dts: imx7ulp: add crypto support (diff)
downloadlinux-dev-1793d1aba1941573ba9ebf75dfbb11a8c2b943b1.tar.xz
linux-dev-1793d1aba1941573ba9ebf75dfbb11a8c2b943b1.zip
crypto: qat - use struct_size() helper
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct qat_alg_buf_list { ... struct qat_alg_buf bufers[]; } __packed __aligned(64); Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. So, replace the following form: sizeof(struct qat_alg_buf_list) + ((1 + n) * sizeof(struct qat_alg_buf)) with: struct_size(bufl, bufers, n + 1) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon')
0 files changed, 0 insertions, 0 deletions