
25 Mar
2014
25 Mar
'14
5:54 p.m.
Dear Stephen Warren,
In message 1395764855-23377-1-git-send-email-swarren@wwwdotorg.org you wrote:
+static inline void update_reg_mask_shift_val(u32 *reg, u32 mask, u32 shift,
u32 val)
+{
- clrsetbits_le32(reg, mask << shift, val << shift);
+}
No, please do not do that. Please use plain clrsetbits_le32() as is. All these hidden shifts are (a) mostly unreadable and (b) sometimes dangerous.
Thanks.
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The use of COBOL cripples the mind; its teaching should, therefore,
be regarded as a criminal offence.
-- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5