[syslinux:master] cpuid: Fixing names & init.

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Mon Apr 25 15:28:05 PDT 2011


Commit-ID:  7f6fa4671e9066369864f9ea21b5e0337410e551
Gitweb:     http://syslinux.zytor.com/commit/7f6fa4671e9066369864f9ea21b5e0337410e551
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Mon, 21 Mar 2011 22:08:54 +0100
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Mon, 21 Mar 2011 22:08:54 +0100

cpuid: Fixing names & init.

The init code was nearly incorrect. Fixed regarding Shao's comments.


---
 com32/gpllib/cpuid.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c
index 3d62541..be33390 100644
--- a/com32/gpllib/cpuid.c
+++ b/com32/gpllib/cpuid.c
@@ -33,15 +33,15 @@ size_t cpu_flags_count = sizeof cpu_flags_names / sizeof *cpu_flags_names;
 struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = { };
 
 bool get_cpu_flag_value_from_name(s_cpu *cpu, const char * flag_name) {
-    size_t i;;
-    bool *flag=false;
+    size_t i;
+    bool cpu_flag_present=false, *flag_value = &cpu_flag_present;
 
     for (i = 0; i < cpu_flags_count; i++) {
 	if (strcmp(cpu_flags_names[i],flag_name) == 0) {
-        	flag = (bool *)((char *)&cpu->flags + cpu_flags_offset[i]);
+        	flag_value = (bool *)((char *)&cpu->flags + cpu_flags_offset[i]);
 	}
     }
-    return *flag;
+    return *flag_value;
 }
 
 



More information about the Syslinux-commits mailing list