All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Bjorn Helgaas via Ksummit-discuss
	<ksummit-discuss@lists.linuxfoundation.org>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Subject: Re: [Ksummit-discuss] [MAINTAINERS SUMMIT] Pull network and Patch Acceptance Consistency
Date: Mon, 17 Jun 2019 07:35:41 -0300	[thread overview]
Message-ID: <20190617073541.3be5735b@coco.lan> (raw)
In-Reply-To: <CAErSpo661k-BSy=LF0kWEyvX-2pNJVCtrsP729MmErTr-hspPQ@mail.gmail.com>

Em Fri, 14 Jun 2019 18:21:15 -0500
Bjorn Helgaas via Ksummit-discuss <ksummit-discuss@lists.linuxfoundation.org> escreveu:

> On Fri, Jun 14, 2019 at 2:53 PM Bjorn Helgaas <bhelgaas@google.com> wrote:
> >
> > On Thu, Jun 6, 2019 at 10:49 AM James Bottomley
> > <James.Bottomley@hansenpartnership.com> wrote:
> >  
> > > 2) Patch Acceptance Consistency: At the moment, we have very different
> > > acceptance criteria for patches into the various maintainer trees.
> > > Some of these differences are due to deeply held stylistic beliefs, but
> > > some could be more streamlined to give a more consistent experience to
> > > beginners who end up doing batch fixes which cross trees and end up
> > > more confused than anything else.  I'm not proposing to try and unify
> > > our entire submission process, because that would never fly, but I was
> > > thinking we could get a few sample maintainer trees to give their
> > > criteria and then see if we could get any streamlining.  For instance,
> > > SCSI has a fairly weak "match the current driver" style requirement, a
> > > reasonably strong get someone else to review it requirement and the
> > > usual good change log and one patch per substantive change requirement.
> > >  Other subsystems look similar without the review requirement, some
> > > have very strict stylistic requirements (reverse christmas tree, one
> > > variable definition per line, etc).  As I said, the goal wouldn't be to
> > >  beat up on the unusual requirements but to see if we could agree some
> > > global baselines that would at least make submission more uniform.  
> >
> > The "when in Rome" rule (follow local conventions) would cover a large
> > fraction of the style issues without requiring global uniformity or
> > even documentation.  I'm amazed at how often it is ignored.  
> 
> I should have expanded this a little.  Somebody pointed out to me off-list that:
> 
> | I'm NOT amazed at how often undocumented, strange, local style
> |  (and submission and timing) conventions are not followed by new or
> | drive-by contributors to a sub-system.  How would one expect local
> | conventions to be followed by newbies when they conventions
> | are undocumented?
> 
> | Many sub-systems have mixed styles. In the past I've wished for
> | documentation as simple as: 'file xyz.c is representative
> | of the preferred style for this sub-system'.
> 
> What I meant was that we should follow the indentation, comment,
> declaration, etc. style of the existing code in the same file.  We
> should also look at the git history of the file and follow the style
> of subject lines and commit logs.

Looking on each file's kernel style would mean a lot of extra work
for someone that is applying a patch that is subsystem-wide (or even
kernel-wide), for no good reason.

My experience from the time we didn't enforce Kernel coding style
on media: people will keep pushing such patches assuming the
Kernel style. It takes a lot more time trying to argue why they
should handle differently for file A, file B, ... than to just 
blindly accept a patch that will mess with the file's coding
Style or than to run a script subsystem-wide to make coding styles
to be more uniform.

Also, even the ones with work at the subsystem will end violating it.

For example, on media, the DVB part used to identify pointers as:

	struct dvb_foo* bar;

While, on the v4l side, it is the Kernel style. As we do have several
drivers that implement both APIs, people tend to use the Kernel style.
So, when a developer is writing a patch that were touching both DVB
and driver-specific stuff, they write the above as:

	struct dvb_foo *bar.

After a few years, the DVB core files become a mess with both styles.

I ended fixing it at the core a couple years ago when we added kernel-doc 
markups to the DVB core files, moving the existing ones at *.c files to be
just at their *.h files. Now, at least the core is closer to the Kernel
style (there are still DVB-specific files with the old style, but those
are very seldom patched) and we don't care much about mixing styles there
anyway.

> 
> Even if a subsystem has mixed styles, I think the most important rule
> is that each file should be internally consistent.  If we want to
> unify subsystem style, that's even better, but we should do that with
> subsystem-wide patches that specifically improve consistency, not
> incrementally as a by-product of other patches.
> 
> I'm not necessarily opposed to documenting coding styles, although I
> think per-subsystem coding style rules might a little bit onerous to
> submitters.  If we pay attention to the surrounding code and commit
> history, we can produce good style even without a style guide.
> 
> Bjorn
> _______________________________________________
> Ksummit-discuss mailing list
> Ksummit-discuss@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss



Thanks,
Mauro

      reply	other threads:[~2019-06-17 10:35 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 15:48 [Ksummit-discuss] [MAINTAINERS SUMMIT] Pull network and Patch Acceptance Consistency James Bottomley
2019-06-06 15:58 ` Greg KH
2019-06-06 16:24   ` James Bottomley
2019-06-13 13:59     ` Mauro Carvalho Chehab
2019-06-14 10:12       ` Laurent Pinchart
2019-06-14 13:24         ` Mauro Carvalho Chehab
2019-06-14 13:31           ` Laurent Pinchart
2019-06-14 13:54             ` Mauro Carvalho Chehab
2019-06-14 14:08               ` Laurent Pinchart
2019-06-14 14:56             ` Mark Brown
2019-06-14 13:58           ` Greg KH
2019-06-14 15:11             ` Mauro Carvalho Chehab
2019-06-14 15:23               ` James Bottomley
2019-06-14 15:43                 ` Mauro Carvalho Chehab
2019-06-14 15:49                   ` James Bottomley
2019-06-14 16:04                     ` Mauro Carvalho Chehab
2019-06-14 16:16                       ` James Bottomley
2019-06-14 17:48                         ` Mauro Carvalho Chehab
2019-06-17  7:01                           ` Geert Uytterhoeven
2019-06-17 13:31                             ` Mauro Carvalho Chehab
2019-06-17 14:26                               ` Takashi Iwai
2019-06-19  7:53                               ` Dan Carpenter
2019-06-19  8:13                                 ` [Ksummit-discuss] [kbuild] " Philip Li
2019-06-19  8:33                                 ` [Ksummit-discuss] " Daniel Vetter
2019-06-19 14:39                                   ` Mauro Carvalho Chehab
2019-06-19 14:48                                     ` [Ksummit-discuss] [media-submaintainers] " Laurent Pinchart
2019-06-19 15:19                                       ` Mauro Carvalho Chehab
2019-06-19 15:46                                       ` James Bottomley
2019-06-19 16:23                                         ` Mark Brown
2019-06-20 12:24                                           ` Geert Uytterhoeven
2019-06-20 10:36                                         ` Jani Nikula
2019-06-19 15:56                                       ` Mark Brown
2019-06-19 16:09                                         ` Laurent Pinchart
2019-06-15 10:55                         ` [Ksummit-discuss] " Daniel Vetter
2019-06-14 20:52               ` Vlastimil Babka
2019-06-15 11:01               ` Laurent Pinchart
2019-06-17 11:03                 ` Mauro Carvalho Chehab
2019-06-17 12:28                   ` Mark Brown
2019-06-17 16:48                     ` Tim.Bird
2019-06-17 17:23                       ` Geert Uytterhoeven
2019-06-17 23:13                       ` Mauro Carvalho Chehab
2019-06-17 14:18                   ` Laurent Pinchart
2019-06-06 16:29   ` James Bottomley
2019-06-06 18:26     ` Dan Williams
2019-06-07 20:14       ` Martin K. Petersen
2019-06-13 13:49         ` Mauro Carvalho Chehab
2019-06-13 14:35           ` James Bottomley
2019-06-13 15:03             ` Martin K. Petersen
2019-06-13 15:21               ` Bart Van Assche
2019-06-13 15:27                 ` James Bottomley
2019-06-13 15:35                 ` Guenter Roeck
2019-06-13 15:39                   ` Bart Van Assche
2019-06-14 11:53                     ` Leon Romanovsky
2019-06-14 17:06                       ` Bart Van Assche
2019-06-15  7:20                         ` Leon Romanovsky
2019-06-13 15:39                   ` James Bottomley
2019-06-13 15:42                   ` Takashi Iwai
2019-06-13 19:28               ` James Bottomley
2019-06-14  9:08               ` Dan Carpenter
2019-06-14  9:43               ` Dan Carpenter
2019-06-14 13:27               ` Dan Carpenter
2019-06-13 17:27             ` Mauro Carvalho Chehab
2019-06-13 18:41               ` James Bottomley
2019-06-13 19:11                 ` Mauro Carvalho Chehab
2019-06-13 19:20                   ` Joe Perches
2019-06-14  2:21                     ` Mauro Carvalho Chehab
2019-06-13 19:57                   ` Martin K. Petersen
2019-06-13 14:53           ` Martin K. Petersen
2019-06-13 17:09             ` Mauro Carvalho Chehab
2019-06-14  3:03               ` Martin K. Petersen
2019-06-14  3:35                 ` Mauro Carvalho Chehab
2019-06-14  7:31                 ` Joe Perches
2019-06-13 13:28       ` Mauro Carvalho Chehab
2019-06-06 16:18 ` Bart Van Assche
2019-06-14 19:53 ` Bjorn Helgaas
2019-06-14 23:21   ` Bjorn Helgaas
2019-06-17 10:35     ` Mauro Carvalho Chehab [this message]

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=20190617073541.3be5735b@coco.lan \
    --to=mchehab+samsung@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=ksummit-discuss@lists.linuxfoundation.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 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.