OSDN Git Service

block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Fri, 21 Aug 2020 19:53:52 +0000 (21:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Sep 2020 10:24:53 +0000 (12:24 +0200)
commit7d3b214ae45be7fafaf514c089360a3efc6bc23f
tree48a541910d06103ff5e7822572bcfe52b7aa7ee8
parent4d980939374054b569dca981b1fb8f353c24a0ac
block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

We allocate an unique chunk of memory then use it for two
different structures. By using an union, we make it clear
the data is overlapping (and we can remove the casts).

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-9-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/nvme.c