Re: [PATCH 01/20] hw/block: Pass DeviceState to pflash_cfi01_get_blk()

2023-01-07 Thread Bin Meng
On Thu, Jan 5, 2023 at 6:40 AM Philippe Mathieu-Daudé wrote: > > The point of a getter() function is to not expose the structure > internal fields. Otherwise callers could simply access the > PFlashCFI01::blk field. > > Have the callers pass a DeviceState* argument. The QOM > type check is done in

[PATCH 01/20] hw/block: Pass DeviceState to pflash_cfi01_get_blk()

2023-01-04 Thread Philippe Mathieu-Daudé
The point of a getter() function is to not expose the structure internal fields. Otherwise callers could simply access the PFlashCFI01::blk field. Have the callers pass a DeviceState* argument. The QOM type check is done in the callee. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/sbsa-ref.c