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

From: Juergen Gross
Date: Sun Oct 30 2022 - 11:06:23 EST


On 30.10.22 13:06, Borislav Petkov wrote:
On Tue, Oct 04, 2022 at 10:10:23AM +0200, Juergen Gross wrote:
+#ifdef CONFIG_X86_64
+#define vendor_mtrr_ops(x) NULL
+#else
+#define vendor_mtrr_ops(x) &(x)
+#endif

The idea is good but this is just as hacky.

Just assign the correct one in each branch without this funky ifdeffery.

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.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature