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:
Junjie Mao
2018-05-28 22:57:09 +08:00
committed by lijinxia
parent b9660eb9d6
commit ef3cb5ba1c
6 changed files with 21 additions and 26 deletions

View File

@@ -353,9 +353,9 @@ static void complete_request(struct vcpu *vcpu)
* mark ioreq done and don't resume vcpu.
*/
if (vcpu->state == VCPU_ZOMBIE) {
struct vhm_request_buffer *req_buf;
union vhm_request_buffer *req_buf;
req_buf = (struct vhm_request_buffer *)
req_buf = (union vhm_request_buffer *)
vcpu->vm->sw.io_shared_page;
req_buf->req_queue[vcpu->vcpu_id].valid = false;
atomic_store(&vcpu->ioreq_pending, 0);
@@ -382,7 +382,7 @@ static void complete_request(struct vcpu *vcpu)
int64_t hcall_notify_req_finish(uint64_t vmid, uint64_t vcpu_id)
{
int64_t ret = 0;
struct vhm_request_buffer *req_buf;
union vhm_request_buffer *req_buf;
struct vhm_request *req;
struct vcpu *vcpu;
struct vm *target_vm = get_vm_from_vmid(vmid);
@@ -397,7 +397,7 @@ int64_t hcall_notify_req_finish(uint64_t vmid, uint64_t vcpu_id)
vcpu = vcpu_from_vid(target_vm, vcpu_id);
ASSERT(vcpu != NULL, "Failed to get VCPU context.");
req_buf = (struct vhm_request_buffer *)target_vm->sw.io_shared_page;
req_buf = (union vhm_request_buffer *)target_vm->sw.io_shared_page;
req = req_buf->req_queue + vcpu_id;
if (req->valid &&