qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/dma/etraxfs_dma: Simplify using MemoryRegionOps::impl acc


From: Peter Maydell
Subject: Re: [PATCH] hw/dma/etraxfs_dma: Simplify using MemoryRegionOps::impl access_size
Date: Sat, 5 Oct 2019 16:33:23 +0100

On Sat, 5 Oct 2019 at 16:04, Philippe Mathieu-Daudé <address@hidden> wrote:
>
> This device implementation is clearly restricted to 32-bit
> accesses. Set the MemoryRegionOps::impl min/max access_size
> fields to simplify the code, and remove the hw_error() call.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  hw/dma/etraxfs_dma.c | 25 ++++---------------------
>  1 file changed, 4 insertions(+), 21 deletions(-)
>
> @@ -701,6 +680,10 @@ static const MemoryRegionOps dma_ops = {
>         .read = dma_read,
>         .write = dma_write,
>         .endianness = DEVICE_NATIVE_ENDIAN,
> +    .impl = {
> +        .min_access_size = 4,
> +        .max_access_size = 4,
> +    },
>         .valid = {
>                 .min_access_size = 1,
>                 .max_access_size = 4

Unless I've forgotten how the memory layer works, doesn't this
mean we'll now try to synthesize 1 and 2 byte accesses by
making 4 byte accesses ? Would it be better to just set the
.valid.min_access_size to 4 ?

(The indent on the change looks a bit suspect but that's
because the whole file is tab-indent.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]