Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Wolfgang Denk
Dear Tom, In message <20140325200435.GV16360@bill-the-cat> you wrote: > > But as Wolfgang's v4 shows, it's also not hard to just call > clrsetbits_le32 directly. Arguably the cases where mask==1 we should > just call setbits_le32 but that's not a big deal. We would have to call setbits_le32() o

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Wolfgang Denk
Dear Tom, In message <20140325200420.GU16360@bill-the-cat> you wrote: > > With respect to danger / readability, no, either way is just as > dangerous (or not dangerous) and it's still fairly dense code either > way and fixing a problem with an incorrect shift value is the same > effort. The key

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Tom Rini
On Tue, Mar 25, 2014 at 05:54:10PM +0100, Wolfgang Denk wrote: > Dear Stephen Warren, > > In message <1395764855-23377-1-git-send-email-swar...@wwwdotorg.org> you > wrote: > > > > +static inline void update_reg_mask_shift_val(u32 *reg, u32 mask, u32 shift, > > +

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Tom Rini
On Tue, Mar 25, 2014 at 10:27:35AM -0600, Stephen Warren wrote: > From: Stephen Warren > > This removes a bunch of open-coded register IO, masking, and shifting. > I would have squashed this into "ARM: tegra: pinctrl: remove duplication" > except that keeping it a separate commit allows easier b

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Wolfgang Denk
Dear Stephen Warren, In message <5331b55b.7080...@wwwdotorg.org> you wrote: > > > 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. > > Seriously, are you joking now? No, I am not. > I

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Stephen Warren
On 03/25/2014 10:54 AM, Wolfgang Denk wrote: > Dear Stephen Warren, > > In message <1395764855-23377-1-git-send-email-swar...@wwwdotorg.org> you > wrote: >> >> +static inline void update_reg_mask_shift_val(u32 *reg, u32 mask, u32 shift, >> + u32 val) >> +{

Re: [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Wolfgang Denk
Dear Stephen Warren, In message <1395764855-23377-1-git-send-email-swar...@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

[U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver

2014-03-25 Thread Stephen Warren
From: Stephen Warren This removes a bunch of open-coded register IO, masking, and shifting. I would have squashed this into "ARM: tegra: pinctrl: remove duplication" except that keeping it a separate commit allows easier bisection of any issues that are introduced by this patch. I also wrote this