[2/9] x86: cpu -- Make cpu_dump_cpuinfo more readable

Submitted by Cyrill Gorcunov on Aug. 7, 2018, 4:35 p.m.

Details

Message ID 20180807163517.21669-3-gorcunov@gmail.com
State New
Series "x86: cpu -- Rework feature testing"
Headers show

Commit Message

Cyrill Gorcunov Aug. 7, 2018, 4:35 p.m.
No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/arch/x86/cpu.c | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index 9eed742e1b7a..9dbc1236111c 100644
--- a/criu/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
@@ -78,24 +78,25 @@  int cpu_dump_cpuinfo(void)
 	if (!img)
 		return -1;
 
-	cpu_info.x86_entry = &cpu_x86_info_ptr;
-	cpu_info.n_x86_entry = 1;
+	cpu_info.x86_entry		= &cpu_x86_info_ptr;
+	cpu_info.n_x86_entry		= 1;
 
-	cpu_x86_info.vendor_id = (rt_cpu_info.x86_vendor == X86_VENDOR_INTEL) ?
+	cpu_x86_info.vendor_id		= (rt_cpu_info.x86_vendor == X86_VENDOR_INTEL) ?
 		CPUINFO_X86_ENTRY__VENDOR__INTEL :
 		CPUINFO_X86_ENTRY__VENDOR__AMD;
-	cpu_x86_info.cpu_family = rt_cpu_info.x86_family;
-	cpu_x86_info.model = rt_cpu_info.x86_model;
-	cpu_x86_info.stepping = rt_cpu_info.x86_mask;
-	cpu_x86_info.capability_ver = 2;
-	cpu_x86_info.n_capability = ARRAY_SIZE(rt_cpu_info.x86_capability);
-	cpu_x86_info.capability = (void *)rt_cpu_info.x86_capability;
-	cpu_x86_info.has_xfeatures_mask = true;
-	cpu_x86_info.xfeatures_mask = rt_cpu_info.xfeatures_mask;
-	cpu_x86_info.has_xsave_size = true;
-	cpu_x86_info.xsave_size = rt_cpu_info.xsave_size;
-	cpu_x86_info.has_xsave_size_max = true;
-	cpu_x86_info.xsave_size_max = rt_cpu_info.xsave_size_max;
+
+	cpu_x86_info.cpu_family		= rt_cpu_info.x86_family;
+	cpu_x86_info.model		= rt_cpu_info.x86_model;
+	cpu_x86_info.stepping		= rt_cpu_info.x86_mask;
+	cpu_x86_info.capability_ver	= 2;
+	cpu_x86_info.n_capability	= ARRAY_SIZE(rt_cpu_info.x86_capability);
+	cpu_x86_info.capability		= (void *)rt_cpu_info.x86_capability;
+	cpu_x86_info.has_xfeatures_mask	= true;
+	cpu_x86_info.xfeatures_mask	= rt_cpu_info.xfeatures_mask;
+	cpu_x86_info.has_xsave_size	= true;
+	cpu_x86_info.xsave_size		= rt_cpu_info.xsave_size;
+	cpu_x86_info.has_xsave_size_max	= true;
+	cpu_x86_info.xsave_size_max	= rt_cpu_info.xsave_size_max;
 
 	if (rt_cpu_info.x86_model_id[0])
 		cpu_x86_info.model_id = rt_cpu_info.x86_model_id;
@@ -321,9 +322,9 @@  static compel_cpuinfo_t *img_to_cpuinfo(CpuinfoX86Entry *img_x86_entry)
 
 	if (img_x86_entry->vendor_id != CPUINFO_X86_ENTRY__VENDOR__INTEL &&
 	    img_x86_entry->vendor_id != CPUINFO_X86_ENTRY__VENDOR__AMD) {
-			pr_err("Image carries unknown vendor %u\n",
-			       (unsigned)img_x86_entry->vendor_id);
-			return NULL;
+		pr_err("Image carries unknown vendor %u\n",
+		       (unsigned)img_x86_entry->vendor_id);
+		return NULL;
 	}
 
 	for (i = 0; i < ARRAY_SIZE(ncapints); i++) {

Comments

Dmitry Safonov Aug. 20, 2018, 12:24 p.m.
2018-08-07 17:35 GMT+01:00 Cyrill Gorcunov <gorcunov@gmail.com>:
> No func changes.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmaill.com>

Thanks,
             Dmitry