All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'josh@joshtriplett.org'" <josh@joshtriplett.org>,
	Joe Perches <joe@perches.com>
Cc: David Miller <davem@davemloft.net>,
	"alistair@popple.id.au" <alistair@popple.id.au>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dan Carpenter <error27@gmail.com>,
	Randy Dunlap <randy.dunlap@oracle.com>
Subject: RE: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
Date: Mon, 10 Mar 2014 09:53:41 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6D8E55@AcuExch.aculab.com> (raw)
In-Reply-To: <20140307213017.GA18769@cloud>

From: josh@joshtriplett.org
> On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote:
> > On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote:
> > > From: Alistair Popple <alistair@popple.id.au>
> > > Date: Thu,  6 Mar 2014 14:52:25 +1100
> > >
> > > > +	out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN
> > > > +		 | WKUP_ETH_TX_OE | WKUP_ETH_RX_IE);
> > >
> > > When an expression spans multiple lines, the lines should end with
> > > operators rather than begin with them.
> >
> > That's not in CodingStyle currently.
> 
> It's also not even remotely consistent across existing kernel code, and
> it isn't obvious that there's a general developer consensus on the
> "right" way to write it.

My personal preference (which counts for nothing here) is to put
the operators at the start of the continuation like in order to
make it more obvious that it is a continuation.

The netdev rules are particularly problematical for code like:
        if (tst(foo, foo2, foo3, ...) && ....... &&
                tst2(......) && tst3()) {
                baz(....);
where a scan read of the LHS gives the wrong logic.

At least we don't have a coding style that allows very long lnes
an puts } and { on their own lines - leading to:
                ...
        }
        while (foo(...) && bar(...) && ..... /* very long line falls off screen */
        {
                int x;
Is that the top or bottom of a loop?

	David




WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight-ZS65k/vG3HxXrIkS9f7CXA@public.gmane.org>
To: "'josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org'"
	<josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>,
	Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	"alistair-Y4h6yKqj69EXC2x5gXVKYQ@public.gmane.org"
	<alistair-Y4h6yKqj69EXC2x5gXVKYQ@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Randy Dunlap
	<randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: RE: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
Date: Mon, 10 Mar 2014 09:53:41 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6D8E55@AcuExch.aculab.com> (raw)
In-Reply-To: <20140307213017.GA18769@cloud>

From: josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org
> On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote:
> > On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote:
> > > From: Alistair Popple <alistair-Y4h6yKqj69EXC2x5gXVKYQ@public.gmane.org>
> > > Date: Thu,  6 Mar 2014 14:52:25 +1100
> > >
> > > > +	out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN
> > > > +		 | WKUP_ETH_TX_OE | WKUP_ETH_RX_IE);
> > >
> > > When an expression spans multiple lines, the lines should end with
> > > operators rather than begin with them.
> >
> > That's not in CodingStyle currently.
> 
> It's also not even remotely consistent across existing kernel code, and
> it isn't obvious that there's a general developer consensus on the
> "right" way to write it.

My personal preference (which counts for nothing here) is to put
the operators at the start of the continuation like in order to
make it more obvious that it is a continuation.

The netdev rules are particularly problematical for code like:
        if (tst(foo, foo2, foo3, ...) && ....... &&
                tst2(......) && tst3()) {
                baz(....);
where a scan read of the LHS gives the wrong logic.

At least we don't have a coding style that allows very long lnes
an puts } and { on their own lines - leading to:
                ...
        }
        while (foo(...) && bar(...) && ..... /* very long line falls off screen */
        {
                int x;
Is that the top or bottom of a loop?

	David



--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: "'josh@joshtriplett.org'" <josh@joshtriplett.org>,
	Joe Perches <joe@perches.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Dan Carpenter <error27@gmail.com>,
	"alistair@popple.id.au" <alistair@popple.id.au>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	David Miller <davem@davemloft.net>
Subject: RE: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
Date: Mon, 10 Mar 2014 09:53:41 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6D8E55@AcuExch.aculab.com> (raw)
In-Reply-To: <20140307213017.GA18769@cloud>

From: josh@joshtriplett.org
> On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote:
> > On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote:
> > > From: Alistair Popple <alistair@popple.id.au>
> > > Date: Thu,  6 Mar 2014 14:52:25 +1100
> > >
> > > > +	out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN
> > > > +		 | WKUP_ETH_TX_OE | WKUP_ETH_RX_IE);
> > >
> > > When an expression spans multiple lines, the lines should end with
> > > operators rather than begin with them.
> >
> > That's not in CodingStyle currently.
>=20
> It's also not even remotely consistent across existing kernel code, and
> it isn't obvious that there's a general developer consensus on the
> "right" way to write it.

My personal preference (which counts for nothing here) is to put
the operators at the start of the continuation like in order to
make it more obvious that it is a continuation.

The netdev rules are particularly problematical for code like:
        if (tst(foo, foo2, foo3, ...) && ....... &&
                tst2(......) && tst3()) {
                baz(....);
where a scan read of the LHS gives the wrong logic.

At least we don't have a coding style that allows very long lnes
an puts } and { on their own lines - leading to:
                ...
        }
        while (foo(...) && bar(...) && ..... /* very long line falls off sc=
reen */
        {
                int x;
Is that the top or bottom of a loop?

	David

  parent reply	other threads:[~2014-03-10  9:54 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  3:52 [PATCH 0/5] V2 IBM Akebono/PPC46GTR Support Alistair Popple
2014-03-06  3:52 ` [PATCH 1/5] SDHCI: Add a generic registration to the SDHCI platform driver Alistair Popple
2014-03-06  3:52   ` Alistair Popple
2014-03-06  3:52 ` [PATCH 2/5] IBM Akebono: Add support for a new PHY interface to the IBM emac driver Alistair Popple
2014-03-06  3:52   ` Alistair Popple
2014-03-07 20:41   ` David Miller
2014-03-07 20:41     ` David Miller
2014-03-07 21:02     ` rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver) Joe Perches
2014-03-07 21:02       ` Joe Perches
2014-03-07 21:02       ` Joe Perches
2014-03-07 21:23       ` rfc: checkpatch logical line continuations David Miller
2014-03-07 21:23         ` David Miller
2014-03-07 21:23         ` David Miller
2014-03-07 21:30       ` rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver) josh
2014-03-07 21:30         ` josh
2014-03-07 21:45         ` Joe Perches
2014-03-07 21:45           ` Joe Perches
2014-03-07 23:04         ` Dan Carpenter
2014-03-07 23:04           ` Dan Carpenter
2014-03-07 23:04           ` Dan Carpenter
2014-03-07 23:15           ` Joe Perches
2014-03-07 23:15             ` Joe Perches
2014-03-10  9:53         ` David Laight [this message]
2014-03-10  9:53           ` David Laight
2014-03-10  9:53           ` David Laight
2014-03-11  0:44     ` [PATCH 2/5 V2] IBM Akebono: Add support for a new PHY interface to the IBM emac driver Alistair Popple
2014-03-11  0:44       ` Alistair Popple
2014-03-11  0:44       ` Alistair Popple
2014-05-02  0:48       ` Alistair Popple
2014-05-02  0:48         ` Alistair Popple
2014-05-02  0:48         ` Alistair Popple
2014-03-06  3:52 ` [PATCH 3/5] IBM Currituck: Clean up board specific code before adding Akebono code Alistair Popple
2014-03-06  3:52 ` [PATCH 4/5] IBM Akebono: Add the Akebono platform Alistair Popple
2014-05-01  9:27   ` [4/5] " Paul Bolle
2014-05-01  9:27     ` Paul Bolle
2014-05-01  9:27     ` Paul Bolle
2014-05-02  0:35     ` Alistair Popple
2014-05-02  0:35       ` Alistair Popple
2014-05-02  2:33       ` Benjamin Herrenschmidt
2014-05-02  2:33         ` Benjamin Herrenschmidt
2014-05-02  2:33         ` Benjamin Herrenschmidt
2014-05-02  8:06         ` [PATCH] IBM Akebono: Remove obsolete config select Alistair Popple
2014-05-02  8:06           ` Alistair Popple
2014-05-02  8:06           ` Alistair Popple
2014-06-13 11:56           ` Paul Bolle
2014-06-13 11:56             ` Paul Bolle
2014-06-13 11:56             ` Paul Bolle
2014-06-20  0:10             ` Alistair Popple
2014-06-20  0:10               ` Alistair Popple
2014-09-04 22:20               ` Paul Bolle
2014-09-04 22:20                 ` Paul Bolle
2014-09-04 22:20                 ` Paul Bolle
2014-09-05  2:39                 ` Alistair Popple
2014-09-05  2:39                   ` Alistair Popple
2014-09-05  2:39                   ` Alistair Popple
2014-09-04 22:29       ` [4/5] IBM Akebono: Add the Akebono platform Paul Bolle
2014-09-04 22:29         ` Paul Bolle
2014-03-06  3:52 ` [PATCH 5/5] powerpc: Added PCI MSI support using the HSTA module Alistair Popple

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=063D6719AE5E284EB5DD2968C1650D6D0F6D8E55@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=akpm@linux-foundation.org \
    --cc=alistair@popple.id.au \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=error27@gmail.com \
    --cc=joe@perches.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.