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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: stm32 - Remove unnecessary checks before calling memcpy

memcpy() can be safely called with size 0, which is a no-op. Remove the
unnecessary checks before calling memcpy().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
da166801 279b837c

+2 -4
+2 -4
drivers/crypto/stm32/stm32-hash.c
··· 1115 1115 return -ENOMEM; 1116 1116 } 1117 1117 1118 - if (state->bufcnt) 1119 - memcpy(buf, rctx->hdev->xmit_buf, state->bufcnt); 1118 + memcpy(buf, rctx->hdev->xmit_buf, state->bufcnt); 1120 1119 1121 1120 scatterwalk_map_and_copy(buf + state->bufcnt, sg, rctx->offset, 1122 1121 min(new_len, rctx->total) - state->bufcnt, 0); ··· 1299 1300 } 1300 1301 1301 1302 /* copy buffer in a temporary one that is used for sg alignment */ 1302 - if (state->bufcnt) 1303 - memcpy(hdev->xmit_buf, state->buffer, state->bufcnt); 1303 + memcpy(hdev->xmit_buf, state->buffer, state->bufcnt); 1304 1304 1305 1305 ret = stm32_hash_align_sgs(req->src, nbytes, bs, init, final, rctx); 1306 1306 if (ret)