From 67f88ffa6d35d6b4e776f98ea64aab0bc026e2a2 Mon Sep 17 00:00:00 2001 From: Jithu Joseph Date: Tue, 21 Mar 2023 17:33:51 -0700 Subject: platform/x86/intel/ifs: Separate ifs_pkg_auth from ifs_data In preparation to supporting additional tests, remove ifs_pkg_auth from per-test scope, as it is only applicable for one test type. This will simplify ifs_init() flow when multiple tests are added. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Link: https://lore.kernel.org/r/20230322003359.213046-2-jithu.joseph@intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede --- drivers/platform/x86/intel/ifs/core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/platform/x86/intel/ifs/core.c') diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 206a617c2e02..3176d94b1fe5 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -20,6 +20,8 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { }; MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); +bool *ifs_pkg_auth; + static struct ifs_device ifs_device = { .data = { .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, @@ -56,13 +58,13 @@ static int __init ifs_init(void) if (!(msrval & BIT(ifs_device.data.integrity_cap_bit))) return -ENODEV; - ifs_device.data.pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); - if (!ifs_device.data.pkg_auth) + ifs_pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); + if (!ifs_pkg_auth) return -ENOMEM; ret = misc_register(&ifs_device.misc); if (ret) { - kfree(ifs_device.data.pkg_auth); + kfree(ifs_pkg_auth); return ret; } @@ -72,7 +74,7 @@ static int __init ifs_init(void) static void __exit ifs_exit(void) { misc_deregister(&ifs_device.misc); - kfree(ifs_device.data.pkg_auth); + kfree(ifs_pkg_auth); } module_init(ifs_init); -- cgit v1.2.3