lkml.org 
[lkml]   [2023]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] crypto: qat - Replace the if statement with min()
Date
Replace the if statement with min_t() to simplify the code

Signed-off-by: You Kangren <youkangren@vivo.com>
---
drivers/crypto/intel/qat/qat_common/qat_uclo.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/intel/qat/qat_common/qat_uclo.c b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
index ce837bcc1cab..b42a4d22b9d2 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_uclo.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
@@ -1986,10 +1986,7 @@ static void qat_uclo_wr_uimage_raw_page(struct icp_qat_fw_loader_handle *handle,
uw_relative_addr = 0;
words_num = encap_page->micro_words_num;
while (words_num) {
- if (words_num < UWORD_CPYBUF_SIZE)
- cpylen = words_num;
- else
- cpylen = UWORD_CPYBUF_SIZE;
+ cpylen = min_t(unsigned int, words_num, UWORD_CPYBUF_SIZE);

/* load the buffer */
for (i = 0; i < cpylen; i++)
--
2.39.0
\
 
 \ /
  Last update: 2023-06-27 09:18    [W:0.041 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site