[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH] x86: Address violations of MISRA C:2012 and drop bool_t



Give a name to unnamed parameters to address violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between object and function declarations thus
addressing violations of MISRA C:2012 Rule 8.3 ("All declarations of an
object or function shall use the same names and type qualifiers").
Replace the occurrences of bool_t with bool.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
---
 xen/arch/x86/cpu/common.c            |  6 +++---
 xen/arch/x86/include/asm/processor.h | 16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index cfcdaace12..5f29148416 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -26,11 +26,11 @@
 
 bool __read_mostly opt_dom0_cpuid_faulting = true;
 
-bool_t opt_arat = 1;
+bool opt_arat = 1;
 boolean_param("arat", opt_arat);
 
 /* pku: Flag to enable Memory Protection Keys (default on). */
-static bool_t opt_pku = 1;
+static bool opt_pku = 1;
 boolean_param("pku", opt_pku);
 
 unsigned int opt_cpuid_mask_ecx = ~0u;
@@ -208,7 +208,7 @@ void ctxt_switch_levelling(const struct vcpu *next)
                alternative_vcall(ctxt_switch_masking, next);
 }
 
-bool_t opt_cpu_info;
+bool opt_cpu_info;
 boolean_param("cpuinfo", opt_cpu_info);
 
 int get_model_name(struct cpuinfo_x86 *c)
diff --git a/xen/arch/x86/include/asm/processor.h 
b/xen/arch/x86/include/asm/processor.h
index 0989748be6..8d1909f73d 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -96,7 +96,7 @@ extern bool probe_cpuid_faulting(void);
 extern void ctxt_switch_levelling(const struct vcpu *next);
 extern void (*ctxt_switch_masking)(const struct vcpu *next);
 
-extern bool_t opt_cpu_info;
+extern bool opt_cpu_info;
 extern u32 trampoline_efer;
 extern u64 trampoline_misc_enable_off;
 
@@ -109,17 +109,17 @@ extern unsigned int vaddr_bits;
 
 extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id table[]);
 
-extern void identify_cpu(struct cpuinfo_x86 *);
-extern void setup_clear_cpu_cap(unsigned int);
-extern void setup_force_cpu_cap(unsigned int);
-extern bool is_forced_cpu_cap(unsigned int);
+extern void identify_cpu(struct cpuinfo_x86 *c);
+extern void setup_clear_cpu_cap(unsigned int cap);
+extern void setup_force_cpu_cap(unsigned int cap);
+extern bool is_forced_cpu_cap(unsigned int cap);
 extern void print_cpu_info(unsigned int cpu);
 extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
 
-unsigned int apicid_to_socket(unsigned int);
+unsigned int apicid_to_socket(unsigned int apicid);
 
 static inline int cpu_nr_siblings(unsigned int cpu)
 {
@@ -410,12 +410,12 @@ void show_registers(const struct cpu_user_regs *regs);
 #define dump_execution_state() \
     run_in_exception_handler(show_execution_state_nonconst)
 void show_page_walk(unsigned long addr);
-void noreturn fatal_trap(const struct cpu_user_regs *regs, bool_t show_remote);
+void noreturn fatal_trap(const struct cpu_user_regs *regs, bool show_remote);
 
 extern void mtrr_ap_init(void);
 extern void mtrr_bp_init(void);
 
-void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
+void mcheck_init(struct cpuinfo_x86 *c, bool bsp);
 
 void do_nmi(const struct cpu_user_regs *regs);
 void do_machine_check(const struct cpu_user_regs *regs);
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.