From: Armando Visconti <armando.visconti@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [u-boot V4] spi/arm-pl022: Add support for ARM PL022 spi controller
Date: Wed, 12 Jun 2013 14:18:38 +0200 [thread overview]
Message-ID: <51B8671E.20008@st.com> (raw)
In-Reply-To: <CAD6G_RThSG4LzvSKaCVMzhjwDiXUbEU1=8mNaZrCB05ut-T-XQ@mail.gmail.com>
Hello Jagan,
>>>
>>>> +
>>>> +/*
>>>> + * ARM PL022 exists in different 'flavors'.
>>>> + * This drivers currently support the standard variant (0x00041022),
>>>> that has a
>>>> + * 16bit wide and 8 locations deep TX/RX FIFO.
>>>> + */
>>>> +static int pl022_is_supported(struct pl022_spi_slave *ps)
>>>> +{
>>>> + struct pl022 *pl022 = (struct pl022 *)ps->regs;
>>>> +
>>>> + /* PL022 version is 0x00041022 */
>>>> + if ((readl(&pl022->ssp_pid0) == 0x22) &&
>>>> + (readl(&pl022->ssp_pid1) == 0x10) &&
>>>> + ((readl(&pl022->ssp_pid2) & 0xf) == 0x04) &&
>>>> + (readl(&pl022->ssp_pid3) == 0x00))
>>>
>>>
>>> Tab space is required, for this if statement i guess, please check.
>>>
>>
>> If I do then checkpatch reports a warning, saying that I need to keep
>> all lines of a 'if' statement aligned properly...
>>
>> So, I guess that this way is more proper.
>
> Agree, but it should be easy to interpret where should the if block
> end and where should the code block starts.
> I always use tab space like
>
>
> +static int pl022_is_supported(struct pl022_spi_slave *ps)
> +{
> + struct pl022 *pl022 = (struct pl022 *)ps->regs;
> +
> + /* PL022 version is 0x00041022 */
> + if ((readl(&pl022->ssp_pid0) == 0x22) &&
> + (readl(&pl022->ssp_pid1) == 0x10) &&
> + ((readl(&pl022->ssp_pid2) & 0xf) == 0x04) &&
> + (readl(&pl022->ssp_pid3) == 0x00))
> + return 1;
> +
> + return 0;
> +}
>
> If you see return 1 is code block, so prior to this if ends.
>
OK, I'll do it in this way even if it may generate warnings.
Give me few mins and I'll send a v6 patch!
Thx,
Arm
--
-- "Every step appears to be the unavoidable consequence of the
-- preceding one." (A. Einstein)
--
Armando Visconti Mobile: (+39) 346 8879146
Senior SW Engineer Fax: (+39) 02 93519290
CPG Work: (+39) 02 93519683
Computer System Division e-mail: armando.visconti at st.com
ST Microelectronics TINA: 051 4683
next prev parent reply other threads:[~2013-06-12 12:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 7:44 [U-Boot] [u-boot V4] spi/arm-pl022: Add support for ARM PL022 spi controller Armando Visconti
2013-06-10 16:01 ` Jagan Teki
2013-06-12 11:10 ` Armando Visconti
2013-06-12 11:36 ` Jagan Teki
2013-06-12 12:18 ` Armando Visconti [this message]
2013-06-12 12:34 ` Jagan Teki
2013-06-12 12:39 ` Armando Visconti
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=51B8671E.20008@st.com \
--to=armando.visconti@st.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.