Subject: Re: [net-next-2.6 04/15] e1000e: checkpatch error - open braces

From: Jeff Garzik <[email-masked]>
Date: Sat, 25 Dec 2010 05:29:16 -0500

On 12/25/2010 01:06 AM, [email-masked] wrote:
> From: Bruce Allan<[email-masked]>
>
> ERROR: that open brace { should be on the previous line
>
> Signed-off-by: Bruce Allan<[email-masked]>
> Tested-by: Emil Tantilov<[email-masked]>
> Signed-off-by: Jeff Kirsher<[email-masked]>
> ---
>   drivers/net/e1000e/es2lan.c  |    4 ++--
>   drivers/net/e1000e/ethtool.c |    4 ++--
>   drivers/net/e1000e/phy.c     |   22 +++++++++++-----------
>   3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
> index 79da646..b18c644 100644
> --- a/drivers/net/e1000e/es2lan.c
> +++ b/drivers/net/e1000e/es2lan.c
> @@ -100,8 +100,8 @@
>    * with a lower bound at "index" and the upper bound at
>    * "index + 5".
>    */
> -static const u16 e1000_gg82563_cable_length_table[] =
> -	 { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
> +static const u16 e1000_gg82563_cable_length_table[] = {
> +	 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
>   #define GG82563_CABLE_LENGTH_TABLE_SIZE \
>   		ARRAY_SIZE(e1000_gg82563_cable_length_table)
>
> diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
> index 15c6330..affcacf 100644
> --- a/drivers/net/e1000e/ethtool.c
> +++ b/drivers/net/e1000e/ethtool.c
> @@ -753,8 +753,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
>   			     int reg, int offset, u32 mask, u32 write)
>   {
>   	u32 pat, val;
> -	static const u32 test[] =
> -		{0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
> +	static const u32 test[] = {
> +		0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
>   	for (pat = 0; pat<  ARRAY_SIZE(test); pat++) {
>   		E1000_WRITE_REG_ARRAY(&adapter->hw, reg, offset,
>   				      (test[pat]&  write));

Gah, that looks worse than the unpatched code.

I think this was an over-literal checkpatch interpretation.  If you look 
at e.g. drivers/net/tg3.c, you see that longer tables have the trailing 
braces on a separate line, where they should be.

IMO, the single-line cases should just be left as they are now in the 
source code.

	Jeff