Re: [PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:27:15PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 12:03 PM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:58:54PM +0200, Philippe Mathieu-Daudé wrote: > >> We allocate an unique chunk of memory then use it for two > >> different structures. By using

Re: [PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Philippe Mathieu-Daudé
On 8/21/20 12:03 PM, Stefano Garzarella wrote: > On Thu, Aug 20, 2020 at 06:58:54PM +0200, Philippe Mathieu-Daudé wrote: >> 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 cas

Re: [PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Stefano Garzarella
On Thu, Aug 20, 2020 at 06:58:54PM +0200, Philippe Mathieu-Daudé wrote: > 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 > Reviewed-by

[PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-20 Thread Philippe Mathieu-Daudé
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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 31