On Tue, 22 Jul 2003, James Courtier-Dutton wrote:

> Oliver Neukum wrote:
> > Am Montag, 21. Juli 2003 23:26 schrieb David Brownell:
> > 
> >>Alan Stern wrote:
> >>
> >>>As far as names go, maybe we can all agree on 
> >>>usb_unbind_driver_interface().
> >>
> >>How about drop the "driver", since nothing else gets unbound?
> >>And the "usb_" prefix, since it's internal to usbcore?
> >>So:  unbind_interface().
> > 
> > 
> > Then better usb_unbind_interface().
> > The convention of dropping the prefix for internal functions
> > has lost a lot of appeal with the introduction of the generic
> > driver model. IMHO the ability to tell them apart quickly and
> > easily is more important.
> > 
> >     Regards
> >             Oliver
> > 
> > 
> Although I don't know the exact context of all this, would the best 
> naming be the most appropriate negative.
> e.g.
> usb_bind_interface()
> and the function that reverses it:
> usb_unbind_interface()
> 
> usb_register_interface()
> usb_unregister_interface()
> 
> etc.
> 
> That should deal with any possible confusion.
> 
> Cheers
> James

The problem ultimately stems from the fact that this function is paired
with usb_device_probe(), hence the original name usb_device_remove().  Of
course, usb_device_probe() wasn't such a good name either.  Maybe the two
functions should both be renamed to

        usb_probe_interface() and usb_unbind_interface().

Like Oliver, I don't think dropping the "usb_" prefix is a good idea.  I 
do that pretty much only for static functions.  Even though these are 
restricted to use by the core, they aren't static.

If nobody objects, and if nobody sees anything else in the original patch
that ought to be changed, I'll resubmit the patch with the new function
names.

Alan Stern

P.S.: While we're on the subject of renaming functions, the most egregious 
example I know of in usbcore is usb_connect().  This function does nothing 
more than select a new, unused USB address.  It ought to be called 
usb_choose_address(), parallel to usb_set_address().  That wouldn't be a 
big change, since the function is called in only one place.  Shall I fold 
that into the patch as well?



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to