public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Chad Kitching <CKitching@powerlandcomputers.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>,
	linux-usb-devel@lists.sourcefoge.net.kroah.org,
	linux-kernel@vger.kernel.org, laforge@gnumonks.org
Subject: Re: My vision of usbmon
Date: Mon, 10 Jan 2005 17:36:01 -0800	[thread overview]
Message-ID: <20050111013601.GG18697@kroah.com> (raw)
In-Reply-To: <18DFD6B776308241A200853F3F83D5072851@pl6w2kex.lan.powerlandcomputers.com>

On Thu, Dec 23, 2004 at 03:02:49PM -0600, Chad Kitching wrote:
> > -----Original Message-----
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: December 21, 2004 11:11 PM
> > Subject: Re: My vision of usbmon
> > 
> > -/* exported only within usbcore */
> > -struct usb_bus *usb_bus_get (struct usb_bus *bus)
> > +struct usb_bus *usb_bus_get(struct usb_bus *bus)
> >  {
> > -	struct class_device *tmp;
> > -
> > -	if (!bus)
> > -		return NULL;
> > -
> > -	tmp = class_device_get(&bus->class_dev);
> > -	if (tmp)        
> > -		return to_usb_bus(tmp);
> > -	else
> > -		return NULL;
> > +	if (bus)
> > +		class_device_get(&bus->class_dev);
> > +	return bus; 
> >  }
> > +EXPORT_SYMBOL_GPL(usb_bus_get);
>   
> I'm not familiar with this code, but if the replacement code is 
> equivalent, is there any point to the return usb_bus pointer?  With 
> the replacement, you should always get the same pointer you put 
> into it.  If that is the case, why not remove the return value, and 
> change drivers/usb/core/usb.c to match?

Because that goes against the "style" of the _get functions in the
driver core.  This way, it's easy to just do:
	some_function(usb_bus_get(my_bus), foo);

thanks,

greg k-h

  reply	other threads:[~2005-01-11  1:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-23 21:02 My vision of usbmon Chad Kitching
2005-01-11  1:36 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-12-20  7:04 Pete Zaitcev
2004-12-22  0:57 ` Greg KH
2004-12-22  1:29   ` Pete Zaitcev
2004-12-22  5:06     ` Greg KH
2004-12-22  5:10       ` Greg KH
2004-12-22  1:38   ` Nick Piggin
2004-12-22  5:04     ` Greg KH
2004-12-22  5:34       ` Jeff Garzik
2004-12-22  6:43         ` Greg KH
     [not found] ` <200412201525.52149.oliver@neukum.org>
2004-12-22  2:25   ` Pete Zaitcev
2004-12-22  5:03     ` Greg KH
2004-12-22 20:46     ` Oliver Neukum

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=20050111013601.GG18697@kroah.com \
    --to=greg@kroah.com \
    --cc=CKitching@powerlandcomputers.com \
    --cc=laforge@gnumonks.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourcefoge.net.kroah.org \
    --cc=zaitcev@redhat.com \
    /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