From mboxrd@z Thu Jan 1 00:00:00 1970 From: Armando Visconti Date: Wed, 12 Jun 2013 14:18:38 +0200 Subject: [U-Boot] [u-boot V4] spi/arm-pl022: Add support for ARM PL022 spi controller In-Reply-To: References: <1370591065-8258-1-git-send-email-armando.visconti@st.com> <51B8572F.4090101@st.com> Message-ID: <51B8671E.20008@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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