mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	Greg KH <gregkh@linuxfoundation.org>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	cocci@systeme.lip6.fr
Subject: Re: [RFC] drop owner assignment from platform_drivers
Date: Sat, 11 Oct 2014 18:15:38 +0100	[thread overview]
Message-ID: <20141011171538.GB27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20141011165650.GA1263@katana>

On Sat, Oct 11, 2014 at 06:56:51PM +0200, Wolfram Sang wrote:
> 
> > > You got me wondering, though, that it could not be correct to call
> > > platform_driver_register() from the platform core instead of module
> > > init. I will check tomorrow. Still, this would be a bug independent of
> > > my series. Although I'd need to respin it if platform_driver_probe()
> > > needed a fix.
> > 
> > Right, this seems to be a preexisting bug. platform_create_bundle 
> > and platform_driver_probe will both overwrite the .owner field with
> > NULL since they live in builtin code. They need to be replaced with
> > __platform_driver_probe and __platform_driver_register that both
> > take an extra owner argument passed down from the caller in the driver
> > module.
> 
> Yeah, that would be one solution. However, my personal favourite would
> meanwhile be to revert the commit that Russell mentioned. I think it is
> cleaner to have the owner explicitly set in the module rather than
> hidden away by a function call. However, grepping through include/linux,
> there are a few subsystems hiding it this way. So, it is a pattern
> somewhow. Oh well...

It really /ought/ to be consistent, because inconsistencies like that
will be a never-ending source of subtle mistakes.

Imagine what it would be like if the kernel was a complete mess of
functions with return type "int" where there was no predominant
pattern of returning negative errno numbers - where it was random
whether int-returning functions returned zero for failure, others
returned zero for success.  We would have to look up every single
function to check it's return style, and it would be a bigger problem
when reviewing code.

There is a lot of value for saving time and reducing errors to have a
consistent, simple and obvious methodology.

(That's not to say that it should be enforced draconian style - but
there'd better be a good reason to be different, rather than "I think
it's better this way" or "my personal style is different".)

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-10-11 17:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  7:24 Wolfram Sang
2014-10-10  7:54 ` [Cocci] " Julia Lawall
2014-10-10 18:04   ` Wolfram Sang
2014-10-10  8:30 ` Arnd Bergmann
2014-10-10 18:12   ` Wolfram Sang
2014-10-10 19:39     ` Arnd Bergmann
2014-10-10  8:36 ` Russell King - ARM Linux
2014-10-10 18:26   ` Wolfram Sang
2014-10-10 19:42     ` Arnd Bergmann
2014-10-11 16:56       ` Wolfram Sang
2014-10-11 17:15         ` Russell King - ARM Linux [this message]
2014-10-11 20:55         ` Greg KH
2014-10-12  5:51           ` Wolfram Sang
2014-10-12 14:24             ` Greg KH
2014-10-12 17:01               ` Wolfram Sang
2014-10-10 21:34     ` Russell King - ARM Linux

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=20141011171538.GB27405@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=arnd@arndb.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®