LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Igor Stoppa <igor.stoppa@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>, linux-kernel@vger.kernel.org
Subject: [RFC: Coding Style] Best way to split a long function declaration with modifiers
Date: Sat, 12 May 2018 18:19:21 +0300	[thread overview]
Message-ID: <4fdc0980-d0af-3a02-02e7-0beed8ba05e2@gmail.com> (raw)

Hi,
I have been wondering if it's ok to break a long (function declaration) 
line in the following way:

static __always_inline
struct foo_bar *__get_foo_bar(type1 parm1, type2 parm2, type3 parm3)


instead of:

static __always_inline struct foo_bar *__get_foo_bar(type1 parm1,
						     type2 parm2,
						     type3 parm3)


I personally like more the former, not to mention that it uses also one 
line less, but it seems less common in the sources.
The coding style references do not seem to say anything explicit about 
which style to prefer.

And not all the code in the kernel is of the same quality, so finding an 
example doesn't automatically mean that it's a good practice to follow :-)

--
thanks, igor

             reply	other threads:[~2018-05-12 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-12 15:19 Igor Stoppa [this message]
2018-05-12 15:41 ` Joe Perches
2018-05-12 16:10   ` Igor Stoppa
     [not found]   ` <CAH2bzCT0BhTy6-hTkaevt1VyYaZpq=AvF6cRpPHs=tzzU76twg@mail.gmail.com>
2018-05-12 16:24     ` Joe Perches

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=4fdc0980-d0af-3a02-02e7-0beed8ba05e2@gmail.com \
    --to=igor.stoppa@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [RFC: Coding Style] Best way to split a long function declaration with modifiers' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).