[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtBQutgSh2j3mFNB@worktop.programming.kicks-ass.net>
Date: Thu, 14 Jul 2022 19:22:02 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Boris Petkov <bp@...en8.de>, Paolo Bonzini <pbonzini@...hat.com>,
Guenter Roeck <linux@...ck-us.net>,
Thadeu Lima de Souza Cascardo <cascardo@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Florian Fainelli <f.fainelli@...il.com>,
kvm list <kvm@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
stable <stable@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Pavel Machek <pavel@...x.de>,
Jon Hunter <jonathanh@...dia.com>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Slade Watkins <slade@...dewatkins.com>, patches@...nelci.org,
Sean Christopherson <seanjc@...gle.com>,
Shuah Khan <shuah@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, X86 ML <x86@...nel.org>,
lkft-triage@...ts.linaro.org,
Alex Bennée <alex.bennee@...aro.org>,
"H. Peter Anvin" <hpa@...or.com>,
Anders Roxell <anders.roxell@...aro.org>
Subject: Re: [PATCH 5.15 00/78] 5.15.55-rc1 review
On Thu, Jul 14, 2022 at 10:02:57AM -0700, Linus Torvalds wrote:
> I like Peter's more obvious use of FASTYOP_LENGTH, but this is just disgusting:
>
> #define FASTOP_SIZE (8 << ((FASTOP_LENGTH > 8) & 1) <<
> ((FASTOP_LENGTH > 16) & 1))
>
> I mean, I understand what it's doing, but just two lines above it the
> code has a "ilog2()" use that already depends on the fact that you can
> use ilog2() as a constant compile-time expression.
>
> And guess what? The code could just use roundup_pow_of_two(), which is
> designed exactly like ilog2() to be used for compile-time constant
> values.
But NR_FASTOP isn't used in ASM.
> So the code should just use
>
> #define FASTOP_SIZE roundup_pow_of_two(FASTOP_LENGTH)
>
> and be a lot more legible, wouldn't it?
If only :/ FASTOP_SIZE is used in ASM, which means we've got to play by
GNU-as rules, and them are aweful.
Powered by blists - more mailing lists