lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230626091541.1064-1-youkangren@vivo.com>
Date:   Mon, 26 Jun 2023 17:15:40 +0800
From:   You Kangren <youkangren@...o.com>
To:     Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        You Kangren <youkangren@...o.com>,
        Adam Guerin <adam.guerin@...el.com>,
        Wojciech Ziemba <wojciech.ziemba@...el.com>,
        Tom Zanussi <tom.zanussi@...ux.intel.com>,
        Damian Muszynski <damian.muszynski@...el.com>,
        Srinivas Kerekare <srinivas.kerekare@...el.com>,
        qat-linux@...el.com (open list:QAT DRIVER),
        linux-crypto@...r.kernel.org (open list:CRYPTO API),
        linux-kernel@...r.kernel.org (open list)
Cc:     opensource.kernel@...o.com
Subject: [PATCH] crypto: qat - Replace the if statement with min()

replace the if statement with min() to make the code clean

Signed-off-by: You Kangren <youkangren@...o.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..56a1947c64ab 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(words_num, UWORD_CPYBUF_SIZE);
 
 		/* load the buffer */
 		for (i = 0; i < cpylen; i++)
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ