[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cc556ef4-684f-6841-b37a-e6432ae86072@synopsys.com>
Date: Mon, 8 Jan 2018 11:35:18 +0800
From: Jie Deng <Jie.Deng1@...opsys.com>
To: Al Viro <viro@....linux.org.uk>, <netdev@...r.kernel.org>
CC: <Jie.Deng1@...opsys.com>, <Jose.Abreu@...opsys.com>
Subject: Re: Subject: [RFC][PATCH 10/11] dwc-xlgmac: fix big-endian breakage
On 2018/1/6 3:32, Al Viro wrote:
> Users of XLGMAC_SET_REG_BITS_LE() expect it to take le32 and return
> le32.
>
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> ---
> drivers/net/ethernet/synopsys/dwc-xlgmac.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac.h b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> index cab3e40a86b9..e95c4c250e16 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> @@ -106,7 +106,7 @@
> #define XLGMAC_GET_REG_BITS_LE(var, pos, len) ({ \
> typeof(pos) _pos = (pos); \
> typeof(len) _len = (len); \
> - typeof(var) _var = le32_to_cpu((var)); \
> + u32 _var = le32_to_cpu((var)); \
> ((_var) & GENMASK(_pos + _len - 1, _pos)) >> (_pos); \
> })
>
> @@ -125,8 +125,8 @@
> typeof(len) _len = (len); \
> typeof(val) _val = (val); \
> _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); \
> - _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; \
> - cpu_to_le32(_var); \
> + (_var & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) | \
> + cpu_to_le32(_val); \
> })
>
> struct xlgmac_pdata;
Thanks for your patch.
Acked-by: Jie Deng <jiedeng@...opsys.com>
Powered by blists - more mailing lists