linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PULL REQUEST] i2c for 4.13
Date: Thu, 13 Jul 2017 22:57:42 +0200	[thread overview]
Message-ID: <e0787679-9238-8f94-522b-5cfaf4411ccd@axentia.se> (raw)
In-Reply-To: <20170713075610.ufck6nxokifamcvs@pengutronix.de>

On 2017-07-13 09:56, Uwe Kleine-König wrote:
> Hello,
> 
> On Wed, Jul 12, 2017 at 10:16:32AM -0700, Linus Torvalds wrote:
>> On Wed, Jul 12, 2017 at 8:49 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>>  drivers/i2c/i2c-core-acpi.c                        |  665 ++++++++
>>>  drivers/i2c/{i2c-core.c => i2c-core-base.c}        | 1684 +-------------------
>>>  drivers/i2c/i2c-core-of.c                          |  276 ++++
>>>  drivers/i2c/i2c-core-slave.c                       |  115 ++
>>>  drivers/i2c/i2c-core-smbus.c                       |  594 +++++++
>>>  drivers/i2c/i2c-core.h                             |   24 +
>>>  drivers/i2c/i2c-stub.c                             |   14 +-
>>
>> Side note on this.. (and doesn't affect the pull - I pulled it and
>> it's going through my test build right now).
>>
>> Please don't do the silly "start every filename with the same prefix".
>> It annoys people (ie me) that use tab-completion, and it just looks
>> stupid.
>>
>> And this core re-org does it twice over - first with "i2c-" and then
>> with "core-".
>>
>> Of *course* it's "i2c-something.c" - it's in the i2c directory. So
>> that part is entirely pointless.
>>
>> And the "core-something.c" part seems to be entirely to keep the files
>> together - but if the issue really is "sort files together", then
>> that's why we have subdirectories.
>>
>> So I personally tend to much prefer
>>
>>    drivers/i2c/core/acpi.c
>>    drivers/i2c/core/base.c
>>    drivers/i2c/core/of.c
>>    drivers/i2c/core/slave.c
>>    drivers/i2c/core/smbus.c
>>    drivers/i2c/core/core.h
>>
>> as the model. Then things *really* sort together, auto-complete works
>> better, and tools like "git diff --dirstat" etc that group changes by
>> directories also automatically just do the right thing.
>>
>> And notice how the filenames are smaller and prettier too? It's just a
>> win/win situation.
>>
>> But I'm not going to enforce my style guide on you, since I very
>> seldom actually end up touching those files. If this was some area
>> where I often actually ended up looking at things, I'd almost require
>> a sane directory structure, though.
>>
>> Because "name things with the same prefix" is not a sane directory structure.
> 
> Another reason I remember for the prefix thing is that this way the
> kernel modules are not named of.ko, core.ko and base.ko. (But this can
> be fixed in the Makefile of course with some more prose.)

And if you, like me, sometimes take a peek at the core of several
subsystems using emacs, the buffers are either named "core.c<subsys>"
or "subsys-core.c". The latter naming is more friendly to tab-completion
after ctrl-x b.

It's not totally black-and-white...

Cheers,
Peter

  reply	other threads:[~2017-07-13 20:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 15:49 [PULL REQUEST] i2c for 4.13 Wolfram Sang
2017-07-12 15:54 ` Wolfram Sang
2017-07-12 17:16 ` Linus Torvalds
2017-07-13  7:56   ` Uwe Kleine-König
2017-07-13 20:57     ` Peter Rosin [this message]
2017-07-13 21:05       ` Linus Torvalds
2017-07-13 21:41         ` Peter Rosin
2017-07-13 10:03   ` Wolfram Sang
2017-07-13 10:50     ` Wolfram Sang
2017-08-09 19:29 Wolfram Sang
2017-08-25 14:30 Wolfram Sang
2017-09-01 21:40 Wolfram Sang

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=e0787679-9238-8f94-522b-5cfaf4411ccd@axentia.se \
    --to=peda@axentia.se \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).