[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1647311321-26303-1-git-send-email-baihaowen@meizu.com>
Date: Tue, 15 Mar 2022 10:28:41 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: <freude@...ux.ibm.com>, <hca@...ux.ibm.com>, <gor@...ux.ibm.com>,
<agordeev@...ux.ibm.com>
CC: <linux-s390@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Haowen Bai <baihaowen@...zu.com>
Subject: [PATCH] s390: crypto: Use min() instead of doing it manually
Fix following coccicheck warning:
drivers/s390/crypto/zcrypt_ep11misc.c:1112:25-26: WARNING opportunity for min()
Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
drivers/s390/crypto/zcrypt_ep11misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/crypto/zcrypt_ep11misc.c b/drivers/s390/crypto/zcrypt_ep11misc.c
index 9ce5a71..bb2a527 100644
--- a/drivers/s390/crypto/zcrypt_ep11misc.c
+++ b/drivers/s390/crypto/zcrypt_ep11misc.c
@@ -1109,7 +1109,7 @@ static int ep11_wrapkey(u16 card, u16 domain,
if (kb->head.type == TOKTYPE_NON_CCA &&
kb->head.version == TOKVER_EP11_AES) {
has_header = true;
- keysize = kb->head.len < keysize ? kb->head.len : keysize;
+ keysize = min(kb->head.len, keysize);
}
/* request cprb and payload */
--
2.7.4
Powered by blists - more mailing lists