summaryrefslogtreecommitdiff
path: root/LICENSES/deprecated
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-06-06 17:57:13 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-13 09:31:41 +0300
commit1793d1aba1941573ba9ebf75dfbb11a8c2b943b1 (patch)
treef5fb556a4e5e654b39d79781c788494b069e4ca2 /LICENSES/deprecated
parent0b211338cf73eb7dd9a1c26721ce43076918373f (diff)
downloadlinux-1793d1aba1941573ba9ebf75dfbb11a8c2b943b1.tar.xz
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 'LICENSES/deprecated')
0 files changed, 0 insertions, 0 deletions