From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 01/11] Add support for MX35 processor
Date: Thu, 20 Jan 2011 12:52:26 +0100 [thread overview]
Message-ID: <20110120115226.CAF72D301D7@gemini.denx.de> (raw)
In-Reply-To: <4D380C25.20901@denx.de>
Dear Stefano Babic,
In message <4D380C25.20901@denx.de> you wrote:
>
> >> + if (readl(&ccm->pdr3) & MXC_CCM_PDR3_UART_M_U)
> >> + freq = get_mcu_main_clk();
> >> + else
> >> + freq = decode_pll(readl(&ccm->ppctl),
> >> + CONFIG_MX35_HCLK_FREQ);
> >
> > Braces needed
>
> checkpatch (and generally accepted in linux, as I can see) requires that
> single statements must not be surrounded by braces. checkpatch returns a
> warning, explaining that braces are not needed.
> I see in the past some comments requiring to remove braces, but it you
> prefer to add them. IMHO it is better to follow the same codestyle as
> linux, using the same tools as checkpatch. I do not know why we have two
> different results from checkpatch, I try to investigate. I had prefer to
I was running an older version of checkpatch...
> >> + case USB_CLK:
> >> + usb_prdf = (reg4 >> 25) & 0x7;
> >> + usb_podf = (reg4 >> 22) & 0x7;
> >> + if (reg4 & 0x200)
> >> + pll = get_mcu_main_clk();
> >> + else
> >> + pll = decode_pll(readl(&ccm->ppctl),
> >> + CONFIG_MX35_HCLK_FREQ);
> >
> > Ditto. Please fix globally.
>
> See my previous comment. I would prefer to not have a different rule in
> u-boot, and not go against some provided tool (we use both checkpatch)
> if not strictly required.
Did you try it?
For me, both
+ if (reg4 & 0x200)
+ pll = get_mcu_main_clk();
+ else
+ pll = decode_pll(readl(&ccm->ppctl),
+ CONFIG_MX35_HCLK_FREQ);
and
+ if (reg4 & 0x200) {
+ pll = get_mcu_main_clk();
+ } else {
+ pll = decode_pll(readl(&ccm->ppctl),
+ CONFIG_MX35_HCLK_FREQ);
+ }
generate _NO_ warnings with checkpatch.
I feel that when the "single statement" is split across several lines,
eventually even including blank lines (see yesterday's discussion
here), then braces are needed.
> > Indeed they should. Why don't you autogenerate these, then?
> >
> > We have all the tools in place, use them.
>
> I will see how to use them.
See tools/scripts/make-asm-offsets
> > Note: the following remark is a question, NOT a change request:
> >
> > Would it not be possible to reduce all these terrible lists? As far
> > as I can tell, the list is built sequentially, with both arguments to
> > _MXC_BUILD_NON_GPIO_PIN() being incremented by 4 for the next
> > register. This begs for automatic code generation, doesn't it?
>
> I do not know if it helps. The list follows exactly the description in
> user manual, and, if you can see a rule for MX35_PIN_A*, it is not so
> simply to find one for other pins, specially for the MXC_BUILD_GPIO_PIN.
> At least, the list is at the moment coherent for all i.MX processors
> (ok, ugly for all). The name of the pin cannot be generated, and it is
> the name found in manual. Miore as generated, the list is sorted....
OK, thanks for the explanation.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"You're just jealous." "What, of an overgrown puppy with a single-
figure IQ?" - Terry Pratchett, _Moving Pictures_
next prev parent reply other threads:[~2011-01-20 11:52 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 8:46 [U-Boot] Adding support for MX35 Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 01/11] Add support for MX35 processor Stefano Babic
2011-01-20 9:25 ` Wolfgang Denk
2011-01-20 10:19 ` Stefano Babic
2011-01-20 11:52 ` Wolfgang Denk [this message]
2011-01-20 17:49 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-02-01 17:50 ` Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 02/11] serial_mxc: add support for Freescale's i.MX35 processor Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 03/11] mxc_i2c: Add support for the " Stefano Babic
2011-01-21 6:28 ` Heiko Schocher
2011-01-20 8:46 ` [U-Boot] [PATCH V2 04/11] I2C: mxc_i2c: get rid of __REG access Stefano Babic
2011-01-20 9:27 ` Wolfgang Denk
2011-01-20 10:23 ` Stefano Babic
2011-01-20 17:50 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-01-21 6:30 ` Heiko Schocher
2011-01-20 8:46 ` [U-Boot] [PATCH V2 05/11] I2C: mxc_i2c: address failure with mx35 processor Stefano Babic
2011-01-20 9:30 ` Wolfgang Denk
2011-01-20 10:27 ` Stefano Babic
2011-01-20 17:51 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-01-21 6:36 ` Heiko Schocher
2011-01-21 9:08 ` Stefano Babic
2011-01-21 9:21 ` Heiko Schocher
2011-01-20 8:46 ` [U-Boot] [PATCH V2 06/11] Add basic support for Freescale's mc9sdz60 Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 07/11] SPI: mxc_spi: add support for i.MX35 processor Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 08/11] SPI: mxc_spi: fix swapping bug and add missing swapping in unaligned rx case Stefano Babic
2011-01-20 9:32 ` Wolfgang Denk
2011-01-20 10:29 ` Stefano Babic
2011-01-20 11:59 ` Wolfgang Denk
2011-01-20 17:53 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-02-01 17:53 ` Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 09/11] SPI: mxc_spi: add SPI clock calculation and setup to the driver Stefano Babic
2011-02-01 17:58 ` Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 10/11] SPI: mxc_spi: replace fixed offsets with structures Stefano Babic
2011-01-20 9:33 ` Wolfgang Denk
2011-01-20 10:30 ` Stefano Babic
2011-01-20 8:46 ` [U-Boot] [PATCH V2 11/11] Add support for Freescale's mx35pdk board Stefano Babic
2011-01-20 9:41 ` Wolfgang Denk
2011-01-20 10:45 ` Stefano Babic
2011-01-20 12:03 ` Wolfgang Denk
2011-01-20 17:53 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-01-20 18:05 ` [U-Boot] [PATCH V4 " Stefano Babic
2011-02-01 17:51 ` Stefano Babic
2011-02-01 17:51 ` [U-Boot] [PATCH V3 " Stefano Babic
2011-01-20 9:52 ` [U-Boot] Adding support for MX35 Wolfgang Denk
2011-01-20 10:50 ` Stefano Babic
2011-01-20 12:04 ` 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=20110120115226.CAF72D301D7@gemini.denx.de \
--to=wd@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