crypto: octeontx2 - use swap() to make code cleaner
authorchiminghao <chi.minghao@zte.com.cn>
Tue, 9 Nov 2021 08:35:03 +0000 (08:35 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 20 Nov 2021 04:02:09 +0000 (15:02 +1100)
Fix the following coccicheck REVIEW:
./drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c:1688:16-17 use swap() to make code cleaner

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c

index 877a948..2748a33 100644 (file)
@@ -1682,11 +1682,8 @@ static void swap_func(void *lptr, void *rptr, int size)
 {
        struct cpt_device_desc *ldesc = lptr;
        struct cpt_device_desc *rdesc = rptr;
-       struct cpt_device_desc desc;
 
-       desc = *ldesc;
-       *ldesc = *rdesc;
-       *rdesc = desc;
+       swap(*ldesc, *rdesc);
 }
 
 int otx2_cpt_crypto_init(struct pci_dev *pdev, struct module *mod,