From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver
Date: Tue, 25 Mar 2014 14:00:32 -0600 [thread overview]
Message-ID: <5331E060.1020201@wwwdotorg.org> (raw)
In-Reply-To: <1395774584-17305-1-git-send-email-wd@denx.de>
On 03/25/2014 01:09 PM, Wolfgang Denk wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> 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 patch on top
> of the series, and pushing it any lower in the series results in some
> conflicts I didn't feel like fixing.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
> V4: [wd] Drop update_reg_mask_shift_val() and use clrsetbits_le32()
> directly.
I believe your own argument compels you to NAK this patch yourself.
In both V3 and V4:
1) Some very simple and obviously understandable open-coded bit
manipulation is replaced with a function call which hides the details of
the bit manipulation.
2) In both cases, the order of parameters to the function does actually
appear to be obvious from the function name: clrsetbits_le32(clr, set),
update_reg_mask_shift_val(reg, mask, shift, val)
3) I've seen plenty of examples where the function name doesn't
correctly describe what the function does, or the parameter order
doesn't match what would appear to be logical. Hence, in neither case is
point (2) relevant; one must /always/ check or remember the prototype of
a function in order to validate that the parameters at a call-site are
correct. Not checking means making an assumption, and assumptions can be
incorrect.
Now, I believe you argued that it was unsafe to hide the details of the
bit manipulation behind a function precisely because it was then harder
to see what the code was doing, and easier to pass the wrong values to
the function parameters, and this wouldn't be obvious at the call site.
I believe the /exact/ same argument applies no matter whether the
function is clrsetbits_le32() or update_reg_mask_shift_val().
Hence, if V3 which used update_reg_mask_shift_val() was unacceptable,
then so is this.
So NAK.
next prev parent reply other threads:[~2014-03-25 20:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 16:27 [U-Boot] [PATCH V3 09/13] ARM: tegra: use clrsetbits_le32 in pinmux driver Stephen Warren
2014-03-25 16:54 ` Wolfgang Denk
2014-03-25 16:56 ` Stephen Warren
2014-03-25 17:06 ` Wolfgang Denk
2014-03-25 20:04 ` Tom Rini
2014-03-25 22:19 ` Wolfgang Denk
2014-03-25 19:09 ` [U-Boot] [PATCH V4 " Wolfgang Denk
2014-03-25 20:00 ` Stephen Warren [this message]
2014-03-25 20:04 ` [U-Boot] [PATCH V3 " Tom Rini
2014-03-25 22:26 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5331E060.1020201@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox