[U-Boot] [PATCH v4 1/3] net: designware: fix descriptor layout and warnings on 64-bit archs
Andreas Färber
afaerber at suse.de
Mon Apr 18 13:55:55 CEST 2016
Am 17.04.2016 um 09:48 schrieb Beniamino Galvani:
> All members of the DMA descriptor must be 32-bit, even on 64-bit
> architectures: change the type to u32 to ensure this. Also, fix
> other warnings.
>
> Signed-off-by: Beniamino Galvani <b.galvani at gmail.com>
> ---
> drivers/net/designware.c | 59 ++++++++++++++++++++++++++----------------------
> drivers/net/designware.h | 4 ++--
> 2 files changed, 34 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index ca58f34..2eda461 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
[...]
> @@ -488,6 +486,11 @@ int designware_initialize(ulong base_addr, u32 interface)
> return -ENOMEM;
> }
>
> + if ((unsigned long long)priv + sizeof(*priv) > (1ULL << 32)) {
>=?
Regards,
Andreas
> + printf("designware: buffers are outside DMA memory\n");
> + return -EINVAL;
> + }
> +
> memset(dev, 0, sizeof(struct eth_device));
> memset(priv, 0, sizeof(struct dw_eth_dev));
>
[snip]
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
More information about the U-Boot
mailing list