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
| ||
|
Date: Mon, 1 Apr 2019 18:01:51 +0000 From: Vineet Gupta <vineet.gupta1@...opsys.com> To: David Laight <David.Laight@...LAB.COM>, "'gregkh@...uxfoundation.org'" <gregkh@...uxfoundation.org>, Andrey Abramov <st5pub@...dex.ru> CC: George Spelvin <lkml@....org>, "adrian.hunter@...el.com" <adrian.hunter@...el.com>, "ard.biesheuvel@...aro.org" <ard.biesheuvel@...aro.org>, "benh@...nel.crashing.org" <benh@...nel.crashing.org>, "bp@...en8.de" <bp@...en8.de>, "darrick.wong@...cle.com" <darrick.wong@...cle.com>, "dchinner@...hat.com" <dchinner@...hat.com>, "dedekind1@...il.com" <dedekind1@...il.com>, "hpa@...or.com" <hpa@...or.com>, "jlbec@...lplan.org" <jlbec@...lplan.org>, "jpoimboe@...hat.com" <jpoimboe@...hat.com>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "linux-snps-arc@...ts.infradead.org" <linux-snps-arc@...ts.infradead.org>, "mark@...heh.com" <mark@...heh.com>, "mingo@...hat.com" <mingo@...hat.com>, "mpe@...erman.id.au" <mpe@...erman.id.au>, "naveen.n.rao@...ux.vnet.ibm.com" <naveen.n.rao@...ux.vnet.ibm.com>, "paulus@...ba.org" <paulus@...ba.org>, "richard@....at" <richard@....at>, "tglx@...utronix.de" <tglx@...utronix.de>, "vgupta@...opsys.com" <vineet.gupta1@...opsys.com>, "x86@...nel.org" <x86@...nel.org> Subject: Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function On 4/1/19 7:46 AM, David Laight wrote: > From: gregkh@...uxfoundation.org >> Sent: 31 March 2019 11:54 > ... >> Yes, "int" is a very nice variable for "size", you need to explain why >> it is better to use size_t here please. > Actually, on x86_64 you probably want 'unsigned int' to avoid the > compiler having to generate a sign-extending register move if the > value is ever used in a 64bit expression (eg an address calculation). Thats likely true for non x86 arches too (for certain on ARC). That is also the reason I dislike "bool", despite its "software engineering" benefits. Per ARC ABI (and likely others too) it is signed 8 bits and any use thereof, requires the compiler to generate an additional EXTB instruction to promote to 32-bit int with sign extension before using the value. -Vineet
Powered by blists - more mailing lists