summaryrefslogtreecommitdiff
path: root/src/arch/i386/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/i386/lib')
-rw-r--r--src/arch/i386/lib/cpu.c4
-rw-r--r--src/arch/i386/lib/exception.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/i386/lib/cpu.c b/src/arch/i386/lib/cpu.c
index c1b2e5fbf1..6deb1f9393 100644
--- a/src/arch/i386/lib/cpu.c
+++ b/src/arch/i386/lib/cpu.c
@@ -123,7 +123,7 @@ static const char *cpu_vendor_name(int vendor)
{
const char *name;
name = "<invalid cpu vendor>";
- if ((vendor < (sizeof(x86_vendor_name)/sizeof(x86_vendor_name[0]))) &&
+ if ((vendor < (ARRAY_SIZE(x86_vendor_name))) &&
(x86_vendor_name[vendor] != 0))
{
name = x86_vendor_name[vendor];
@@ -185,7 +185,7 @@ static void identify_cpu(struct device *cpu)
}
}
cpu->vendor = X86_VENDOR_UNKNOWN;
- for(i = 0; i < sizeof(x86_vendors)/sizeof(x86_vendors[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(x86_vendors); i++) {
if (memcmp(vendor_name, x86_vendors[i].name, 12) == 0) {
cpu->vendor = x86_vendors[i].vendor;
break;
diff --git a/src/arch/i386/lib/exception.c b/src/arch/i386/lib/exception.c
index 5f0c4e0563..2d68b918ed 100644
--- a/src/arch/i386/lib/exception.c
+++ b/src/arch/i386/lib/exception.c
@@ -377,7 +377,7 @@ void x86_exception(struct eregs *info)
gdb_stub_registers[CS] = info->cs;
gdb_stub_registers[PS] = info->eflags;
signo = GDB_UNKNOWN;
- if (info->vector < sizeof(exception_to_signal)/sizeof(exception_to_signal[0])) {
+ if (info->vector < ARRAY_SIZE(exception_to_signal)) {
signo = exception_to_signal[info->vector];
}