mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
treewide: remove unnecessary unnamed structs/unions
According to the syntax defined in C99, each struct/union field must have an identifier. This patch removes unnamed struct/union fields that can be easily expressed in a C99-compatible way. Here is a summary of structs/unions removed. struct vhm_request: union { uint32_t type; uint32_t type; int32_t reserved0[16]; => int32_t reserved0[15]; }; struct vhm_request_buffer: struct vhm_request_buffer { union { union vhm_request_buffer { struct vhm_request ...; => struct vhm_request ...; int8_t reserved[4096]; int8_t reserved[4096]; } } } Signed-off-by: Junjie Mao <junjie.mao@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
@@ -291,9 +291,9 @@ int dm_emulate_mmio_post(struct vcpu *vcpu)
|
||||
{
|
||||
int ret = 0;
|
||||
int cur = vcpu->vcpu_id;
|
||||
struct vhm_request_buffer *req_buf;
|
||||
union vhm_request_buffer *req_buf;
|
||||
|
||||
req_buf = (struct vhm_request_buffer *)(vcpu->vm->sw.io_shared_page);
|
||||
req_buf = (union vhm_request_buffer *)(vcpu->vm->sw.io_shared_page);
|
||||
|
||||
vcpu->req.reqs.mmio_request.value =
|
||||
req_buf->req_queue[cur].reqs.mmio_request.value;
|
||||
|
@@ -34,12 +34,12 @@ int dm_emulate_pio_post(struct vcpu *vcpu)
|
||||
{
|
||||
int cur = vcpu->vcpu_id;
|
||||
int cur_context = vcpu->arch_vcpu.cur_context;
|
||||
struct vhm_request_buffer *req_buf = NULL;
|
||||
union vhm_request_buffer *req_buf = NULL;
|
||||
uint32_t mask =
|
||||
0xFFFFFFFFul >> (32 - 8 * vcpu->req.reqs.pio_request.size);
|
||||
uint64_t *rax;
|
||||
|
||||
req_buf = (struct vhm_request_buffer *)(vcpu->vm->sw.io_shared_page);
|
||||
req_buf = (union vhm_request_buffer *)(vcpu->vm->sw.io_shared_page);
|
||||
|
||||
rax = &vcpu->arch_vcpu.contexts[cur_context].guest_cpu_regs.regs.rax;
|
||||
vcpu->req.reqs.pio_request.value =
|
||||
|
Reference in New Issue
Block a user