Skip to content

Commit

Permalink
HV:treewide:rename union lapic_id and struct segment
Browse files Browse the repository at this point in the history
For data structure types "union lapic_id and struct segment",
its name is identical with variable name in the same scope. This MISRA C
violation is detected by static analysis tool.

Naming convention rule:If the data structure is corresponding
to hardware resource (such as register, segment selector),
its name need resource shorten name suffix (such as _reg, _sel).

The following udpates are made:
union lapic_id-->union lapic_id_reg
struct segment-->struct segment_sel

Signed-off-by: Xiangyang Wu <xiangyang.wu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
  • Loading branch information
Xiangyang Wu authored and lijinxia committed Jul 30, 2018
1 parent c477211 commit 159d57b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions hypervisor/include/arch/x86/guest/vcpu.h
Expand Up @@ -100,7 +100,7 @@ struct cpu_gp_regs {
uint64_t r15;
};

struct segment {
struct segment_sel {
uint16_t selector;
uint64_t base;
uint32_t limit;
Expand Down Expand Up @@ -155,16 +155,16 @@ struct run_context {
uint64_t vmx_cr4;

/* segment registers */
struct segment cs;
struct segment ss;
struct segment ds;
struct segment es;
struct segment fs;
struct segment gs;
struct segment tr;
struct segment idtr;
struct segment ldtr;
struct segment gdtr;
struct segment_sel cs;
struct segment_sel ss;
struct segment_sel ds;
struct segment_sel es;
struct segment_sel fs;
struct segment_sel gs;
struct segment_sel tr;
struct segment_sel idtr;
struct segment_sel ldtr;
struct segment_sel gdtr;

/* The 512 bytes area to save the FPU/MMX/SSE states for the guest */
uint64_t
Expand Down
2 changes: 1 addition & 1 deletion hypervisor/include/arch/x86/lapic.h
Expand Up @@ -112,7 +112,7 @@ enum intr_cpu_startup_shorthand {
INTR_CPU_STARTUP_UNKNOWN,
};

union lapic_id {
union lapic_id_reg {
uint32_t value;
struct {
uint8_t xapic_id;
Expand Down

0 comments on commit 159d57b

Please sign in to comment.