Skip to contentSkip to conversation

crypto: marvell/octeontx - Use swap() instead of open coding it

PATCH In review Jiapeng Chong 2 participants 2 messages Mar 4, 2022 – Mar 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: marvell/octeontx - Use swap() instead of open coding it

Clean the following coccicheck warning:

./drivers/crypto/marvell/octeontx/otx_cptvf_algs.c:1645:16-17: WARNING opportunity for swap().

---
 drivers/crypto/marvell/octeontx/otx_cptvf_algs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/crypto/marvell/octeontx/otx_cptvf_algs.c +1 -4
index ccbef01888d4..01c48ddc4eeb 100644
@@ -1639,11 +1639,8 @@ static void swap_func(void *lptr, void *rptr, int size)
 {
 	struct cpt_device_desc *ldesc = (struct cpt_device_desc *) lptr;
 	struct cpt_device_desc *rdesc = (struct cpt_device_desc *) rptr;
-	struct cpt_device_desc desc;
 
-	desc = *ldesc;
-	*ldesc = *rdesc;
-	*rdesc = desc;
+	swap(*ldesc, *rdesc);
 }
 
 int otx_cpt_crypto_init(struct pci_dev *pdev, struct module *mod,
Signature · 1 line
2.20.1.7.g153144c
maintainer
#1 lore raw
Quoted 10 lines · Jiapeng Chong

Clean the following coccicheck warning:

./drivers/crypto/marvell/octeontx/otx_cptvf_algs.c:1645:16-17: WARNING opportunity for swap().

---
 drivers/crypto/marvell/octeontx/otx_cptvf_algs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt