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] [day] [month] [year] [list]
Message-ID: <d8a518c4a4014307b30020b38022d633@AcuMS.aculab.com>
Date:   Tue, 1 Nov 2022 11:16:17 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Bo Liu' <liubo03@...pur.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>
CC:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] KVM: replace ternary operator with min()

From: Bo Liu
> Sent: 01 November 2022 07:25
> 
> Fix the following coccicheck warning:
> 
> virt/kvm/kvm_main.c:5289:10-11: WARNING opportunity for min()
...
> -	return r < 0 ? r : 0;
> +	return min(r, 0);

As has been repeatedly pointer out this is bogus.
min() should only be used for 'sizes'.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ