diff options
author | Richard Braun <rbraun@sceen.net> | 2014-11-17 22:45:39 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-11-17 22:50:55 +0100 |
commit | aa54b8702906bef24d0252d6e5e9a441e12d27d8 (patch) | |
tree | 1e81ffa026e3e9d2a3da4298f2ebd0efc1fb2ea3 /arch/x86/machine/cpu.c | |
parent | 17d6885ed6b49f52cf4fc2d03745ef73512a0730 (diff) |
x86/cpu: fix comparisons between pointers and zero.
While not technically a mistake, it's part of the (not yet explicit)
coding rules not to compare pointers to zero.
Diffstat (limited to 'arch/x86/machine/cpu.c')
-rw-r--r-- | arch/x86/machine/cpu.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index a5ea4d9..1f4ebb0 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -167,7 +167,7 @@ cpu_preinit(struct cpu *cpu, unsigned int id, unsigned int apic_id) cpu->id = id; cpu->apic_id = apic_id; cpu->state = CPU_STATE_OFF; - cpu->boot_stack = 0; + cpu->boot_stack = NULL; } static void @@ -315,7 +315,7 @@ cpu_init_tss(struct cpu *cpu) memset(tss, 0, sizeof(*tss)); #ifdef __LP64__ - assert(cpu->double_fault_stack != 0); + assert(cpu->double_fault_stack != NULL); tss->ist[CPU_TSS_IST_DF] = (unsigned long)cpu->double_fault_stack; #endif /* __LP64__ */ @@ -329,7 +329,7 @@ cpu_init_double_fault_tss(struct cpu *cpu) struct cpu_tss *tss; assert(cpu_double_fault_handler != 0); - assert(cpu->double_fault_stack != 0); + assert(cpu->double_fault_stack != NULL); tss = &cpu->double_fault_tss; memset(tss, 0, sizeof(*tss)); @@ -644,12 +644,12 @@ cpu_mp_setup(void) cpu = percpu_ptr(cpu_desc, i); cpu->boot_stack = vm_kmem_alloc(STACK_SIZE); - if (cpu->boot_stack == 0) + if (cpu->boot_stack == NULL) panic("cpu: unable to allocate boot stack for cpu%u", i); cpu->double_fault_stack = vm_kmem_alloc(STACK_SIZE); - if (cpu->double_fault_stack == 0) + if (cpu->double_fault_stack == NULL) panic("cpu: unable to allocate double fault stack for cpu%u", i); } |