[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1eXXje-0002Eh-Jq@ZenIV.linux.org.uk>
Date: Fri, 05 Jan 2018 19:32:58 +0000
From: Al Viro <viro@....linux.org.uk>
To: netdev@...r.kernel.org
Cc: <jiedeng@...opsys.com>, Deng@....linux.org.uk, Jie@....linux.org.uk
Subject: Subject: [RFC][PATCH 10/11] dwc-xlgmac: fix big-endian breakage
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;
--
2.11.0
Powered by blists - more mailing lists