Re: [PATCH v4 16/16] x86/mtrr: simplify mtrr_ops initialization

From: Juergen Gross
Date: Tue Nov 01 2022 - 05:48:20 EST


On 30.10.22 17:39, Borislav Petkov wrote:
On Sun, Oct 30, 2022 at 04:05:29PM +0100, Juergen Gross wrote:
As the specific ops variables are available for X86_32 only, this
would require to add an "#ifdef CONFIG_X86_32" around the code block
doing the assignments. Otherwise the build would fail.

Well, it looks like my compiler is smart enough and eliminates all that
dead code, see diff below.

I have the suspicion, though, that clang might not be that smart.

Hmm, with the cpu_feature_enabled() implementation it should be quite
obvious that this is all dead code.

I'm going with dropping the vendor_mtrr_ops() macro for now.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature