Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753875Ab3IWN3L (ORCPT ); Mon, 23 Sep 2013 09:29:11 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:32202 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410Ab3IWN3H (ORCPT ); Mon, 23 Sep 2013 09:29:07 -0400 Date: Mon, 23 Sep 2013 16:29:02 +0300 From: Dan Carpenter To: Peter Senna Tschudin Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: checkpatch guide for newbies Message-ID: <20130923132901.GH6247@mwanda> References: <20130923090100.GE6192@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1468 Lines: 39 On Mon, Sep 23, 2013 at 02:46:38PM +0200, Peter Senna Tschudin wrote: > > It's preferred if the operator goes at the end of the first line instead of at > > the start of the second line: > > Bad: > > - PowerData = (1 << 31) | (0 << 30) | (24 << 24) > > - | BitReverse(w89rf242_txvga_data[i][0], 24); > > Good: > > + PowerData = (1 << 31) | (0 << 30) | (24 << 24) | > > + BitReverse(w89rf242_txvga_data[i][0], 24); > What is the rule for where to start the second line here? > The if statement alignment has become a rule and people will make you redo it if it's not aligned. I haven't seen anyone have to redo a patch because of alignment on these: My favorite format is aligned: foo = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; Also popular: foo = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; Right aligned looks like nonsense: foo = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; Here is a more complex aligned statement: foo = bar * (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy); regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/