Re: [PATCH] hw/char/goldfish: Use DMA memory API

2024-07-23 Thread Philippe Mathieu-Daudé
On 23/7/24 20:18, Philippe Mathieu-Daudé wrote: Rather than using address_space_rw(..., 0 or 1), use the simpler DMA memory API which expand to the same code. This allows removing a cast on the 'buf' variable which is really const. Since 'buf' is only used in the CMD_READ_BUFFER case, we can redu

Re: [PATCH] hw/char/goldfish: Use DMA memory API

2024-07-23 Thread Pierrick Bouvier
On 7/23/24 11:18, Philippe Mathieu-Daudé wrote: Rather than using address_space_rw(..., 0 or 1), use the simpler DMA memory API which expand to the same code. This allows removing a cast on the 'buf' variable which is really const. Since 'buf' is only used in the CMD_READ_BUFFER case, we can redu

Re: [PATCH] hw/char/goldfish: Use DMA memory API

2024-07-23 Thread Peter Xu
On Tue, Jul 23, 2024 at 08:18:50PM +0200, Philippe Mathieu-Daudé wrote: > Rather than using address_space_rw(..., 0 or 1), > use the simpler DMA memory API which expand to > the same code. This allows removing a cast on > the 'buf' variable which is really const. Since > 'buf' is only used in the C

[PATCH] hw/char/goldfish: Use DMA memory API

2024-07-23 Thread Philippe Mathieu-Daudé
Rather than using address_space_rw(..., 0 or 1), use the simpler DMA memory API which expand to the same code. This allows removing a cast on the 'buf' variable which is really const. Since 'buf' is only used in the CMD_READ_BUFFER case, we can reduce its scope. Signed-off-by: Philippe Mathieu-Dau