public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Tejun Heo <tj@kernel.org>
Cc: Grant Grundler <grundler@parisc-linux.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org, Shane Huang <Shane.Huang@amd.com>
Subject: Re: [PATCH] pci: separate out pci_add_dynid()
Date: Wed, 2 Sep 2009 17:05:06 -0700	[thread overview]
Message-ID: <20090903000506.GA31897@kroah.com> (raw)
In-Reply-To: <4A9EF510.9080902@kernel.org>

On Thu, Sep 03, 2009 at 07:43:28AM +0900, Tejun Heo wrote:
> Ummm... another thought.
> 
> Tejun Heo wrote:
> > It's one of the gripes I've had with the driver core interface.
> > Returning the object which had its reference bumped up is nice to do
> > do_something(get_driver(driver)); but it should have been made clear
> > that the return value always equals the input parameter.  IIRC, in the
> > early days of the current driver model and kref, there were intentions
> > to make kref somehow more capable and handle the last reference
> > problem from within it so that if (get_driver(driver)) test is
> > actually meaningful but that turned out to be not too feasible, so we
> > ended up with unnecessary if () around driver model get functions.  I
> > try to remove them whenever an affected piece of code is being
> > modified but there still are plenty left.  I'll update comment on
> > driver core get functions.
> 
> Greg, I think I suggested this before.  What do you think about just
> making those get functions return void?

I have no objection to that at all.

> The current interface combined with widespread if() around them is
> quite misleading.

I agree.

> Most device/driver structures are inherited and extended when actually
> in use, so the driver or its subsystem code usually can't do much with
> the return value other than checking for bogus error condition anyway.

I totally agree.

thanks,

greg k-h

      reply	other threads:[~2009-09-03  0:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02  9:20 [PATCH] pci: separate out pci_add_dynid() Tejun Heo
2009-09-02  9:22 ` [PATCH 2/2] pci-stub: add pci_stub.ids parameter Tejun Heo
2009-09-02 13:30 ` [PATCH] pci: separate out pci_add_dynid() Greg KH
2009-09-02 22:29   ` Tejun Heo
2009-09-02 16:10 ` Grant Grundler
2009-09-02 17:56   ` Greg KH
2009-09-02 22:38   ` Tejun Heo
2009-09-02 22:43     ` Tejun Heo
2009-09-03  0:05       ` Greg KH [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=20090903000506.GA31897@kroah.com \
    --to=greg@kroah.com \
    --cc=Shane.Huang@amd.com \
    --cc=grundler@parisc-linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=tj@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