mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: NeilBrown <neilb@suse.com>,
	Cristian Sicilia <sicilia.cristian@gmail.com>,
	Vaibhav Hiremath <hvaibhav.linux@gmail.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vaibhav Agarwal <vaibhav.sr@gmail.com>,
	Mark Greer <mgreer@animalcreek.com>,
	Rui Miguel Silva <rmfrfs@gmail.com>, David Lin <dtwlin@gmail.com>
Cc: Viresh Kumar <vireshk@kernel.org>,
	Bryan O'Donoghue <pure.logic@nexus-software.ie>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: Parenthesis alignment
Date: Wed, 21 Nov 2018 02:11:00 -0800	[thread overview]
Message-ID: <9704b8ad06e556fc3d412d8b4962baf2f38e8818.camel@perches.com> (raw)
In-Reply-To: <87zhu3auwi.fsf@notabene.neil.brown.name>

On Wed, 2018-11-21 at 15:58 +1100, NeilBrown wrote:
> On Sun, Nov 18 2018, Joe Perches wrote:
> 
> > On Sun, 2018-11-18 at 20:28 +0100, Cristian Sicilia wrote:
> > > Some parameters are aligned with parentheses.
> > > Some parentheses are opened at end of line.
> > 
> > Given the very long identifier lengths, I wouldn't
> > consider many of these appropriate.
> > 
> > 80 column line lengths and long identifiers don't
> > play well together.
> > 
> > > diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> > 
> > []
> > > @@ -70,7 +70,7 @@ static int gbaudio_module_enable_tx(struct gbaudio_codec_info *codec,
> > >  		i2s_port = 0;	/* fixed for now */
> > >  		cportid = data->connection->hd_cport_id;
> > >  		ret = gb_audio_apbridgea_register_cport(data->connection,
> > > -						i2s_port, cportid,
> > > +							i2s_port, cportid,
> > >  						AUDIO_APBRIDGEA_DIRECTION_TX);
> 
> My preferred formatting in this situation is
> 
>   		ret = gb_audio_apbridgea_register_cport(
>                 	data->connection,
>  			i2s_port, cportid,
> 			AUDIO_APBRIDGEA_DIRECTION_TX);

Odd mixing of spacing and tabs in your example here.

> but checkpatch doesn't like the '(' at the end of the line.
> Do you know why that is?

Generally to avoid function declarations like

static int foo(
	int bar,
	int baz)
{
	...
}

But this also is meant for function calls.

And this obviously does not work well with excessively
long identifiers where a statement or declaration could
not fit in 80 columns.

Perhaps some logic could be added to suggest use of
shorter than some specific longish identifier length.

cheers, Joe


  reply	other threads:[~2018-11-21 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18 19:28 Cristian Sicilia
2018-11-18 19:42 ` Joe Perches
2018-11-21  4:58   ` NeilBrown
2018-11-21 10:11     ` Joe Perches [this message]
2018-11-20  9:43 ` Greg Kroah-Hartman
     [not found]   ` <CACU=YuXesdrT2keMHe33fHRiq0PPKwcQMnp6fGCXgCTbz-kmQw@mail.gmail.com>
2018-11-21  6:09     ` Greg Kroah-Hartman
2018-11-25 16:58 Cristian Sicilia

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=9704b8ad06e556fc3d412d8b4962baf2f38e8818.camel@perches.com \
    --to=joe@perches.com \
    --cc=dtwlin@gmail.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvaibhav.linux@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgreer@animalcreek.com \
    --cc=neilb@suse.com \
    --cc=pure.logic@nexus-software.ie \
    --cc=rmfrfs@gmail.com \
    --cc=sicilia.cristian@gmail.com \
    --cc=vaibhav.sr@gmail.com \
    --cc=vireshk@kernel.org \
    /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

all inboxes | Powered by JetHome®