[PATCH 2.6.14-rc3 1/1] chrp_pegasos_eth: Added Marvell Discovery II SRAM support

Dale Farnsworth dale at farnsworth.org
Sat Oct 15 07:42:17 EST 2005


On Fri, Oct 14, 2005 at 05:18:30PM +0200, Sven Luther wrote:
> On Fri, Oct 14, 2005 at 01:56:41PM -0000, Dale Farnsworth wrote:
> > > -	static struct pci_device_id pci_marvell_mv64360[] = {
> > > +	static struct pci_device_id pci_marvell_mv64360[] =
> > > +	{
> > 
> > > +	if (pci_dev_present(pci_marvell_mv64360))
> > > +	{
> > 
> > Open brace should not be on a line by itself except in function definitions.
> 
> Oh, neat, i knew i should not use same-line-braces for function but didn't
> know i should use them for non-functions :)

???

I guess what I wrote wasn't clear, since in his most recent patch,
Nicolas added more places like the above where the "{" has been moved
to a line by itself.  Just the opposite of what I meant to suggest.

>From Documentation/CodingStyle:
>		Chapter 3: Placing Braces
>
>The other issue that always comes up in C styling is the placement of
>braces.  Unlike the indent size, there are few technical reasons to
>choose one placement strategy over the other, but the preferred way, as
>shown to us by the prophets Kernighan and Ritchie, is to put the opening
>brace last on the line, and put the closing brace first, thusly:
>
>	if (x is true) {
>		we do y
>	}
>
>However, there is one special case, namely functions: they have the
>opening brace at the beginning of the next line, thus:
>
>	int function(int x)
>	{
>		body of function
>	}

-Dale



More information about the Linuxppc-dev mailing list