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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Mar 2022 09:25:17 +0000
From:   白浩文 <baihaowen@...zu.com>
To:     Heiko Carstens <hca@...ux.ibm.com>
CC:     "freude@...ux.ibm.com" <freude@...ux.ibm.com>,
        "gor@...ux.ibm.com" <gor@...ux.ibm.com>,
        "agordeev@...ux.ibm.com" <agordeev@...ux.ibm.com>,
        "linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 答复: [PATCH v2] s390: crypto: Use min() instead of doing it manually

hi, Heiko

Thank you for your reply and suggestion.
________________________________________
发件人: Heiko Carstens <hca@...ux.ibm.com>
发送时间: 2022年3月15日 17:15:51
收件人: 白浩文
抄送: freude@...ux.ibm.com; gor@...ux.ibm.com; agordeev@...ux.ibm.com; linux-s390@...r.kernel.org; linux-kernel@...r.kernel.org
主题: Re: [PATCH v2] s390: crypto: Use min() instead of doing it manually

On Tue, Mar 15, 2022 at 04:01:04PM +0800, Haowen Bai wrote:
> 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((size_t)kb->head.len, keysize);

I would assume that checkpatch will now warn that this is an
opportunity to use min_t()...
Anyway, it is up to Harald to decide what do with this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ