From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/4] MX5: Make the weim structure complete
Date: Fri, 20 May 2011 10:37:05 +0200 [thread overview]
Message-ID: <4DD62831.3090108@denx.de> (raw)
In-Reply-To: <1305833248-30716-1-git-send-email-fabio.estevam@freescale.com>
On 05/19/2011 09:27 PM, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Hi Fabio,
> + * WEIM CSnGCR1
> + */
> +#define CSEN(x) (x)
> +#define SWR(x) ((x) << 1)
> +#define SRD(x) ((x) << 2)
> +#define MUM(x) ((x) << 3)
> +#define WFL(x) ((x) << 4)
Probably the macros for single bits can take confusion. Why do we need a
parameter ?
I am expecting that CSEN(1) sets the bit and CSEN(0) resets the bit, and
this is obviously not the case, because we use them in or-wise or to
mask some bits. For single bits there is no test about the parameter and
I could use CSEN(7), and that is completely wrong.
Is it not better to remove the parameter for single bits ? If we define
for example
SRD (1 << 2)
it is always clear what we want to do and there is no way to generate
confusion. And no need to check the parameter.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de
=====================================================================
prev parent reply other threads:[~2011-05-20 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 19:27 [U-Boot] [PATCH v4 1/4] MX5: Make the weim structure complete Fabio Estevam
2011-05-19 19:27 ` [U-Boot] [PATCH v4 2/4] MX5: Add iomux structure Fabio Estevam
2011-05-19 19:27 ` [U-Boot] [PATCH v4 3/4] MX5: Introduce a function for setting the chip select size Fabio Estevam
2011-05-19 19:27 ` [U-Boot] [PATCH v4 4/4] MX53: Add initial support for MX53ARD Fabio Estevam
2011-05-20 8:37 ` Stefano Babic [this message]
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=4DD62831.3090108@denx.de \
--to=sbabic@denx.de \
--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