lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0812291111581.2250-100000@iolanthe.rowland.org>
Date:	Mon, 29 Dec 2008 11:13:24 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Julia Lawall <julia@...u.dk>
cc:	gregkh@...e.de, <dbrownell@...rs.sourceforge.net>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 10/13] drivers/usb/gadget: use USB API functions rather
 than constants

On Mon, 29 Dec 2008, Julia Lawall wrote:

> > ...
> > 
> > > diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
> > > index 88fedd0..c44092b 100644
> > > --- a/drivers/usb/gadget/file_storage.c
> > > +++ b/drivers/usb/gadget/file_storage.c
> > > @@ -248,6 +248,7 @@
> > >  #include <linux/freezer.h>
> > >  #include <linux/utsname.h>
> > >  
> > > +#include <linux/usb.h>
> > >  #include <linux/usb/ch9.h>
> > >  #include <linux/usb/gadget.h>
> > 
> > While there's nothing wrong with this part of the patch, it hardly 
> > seems necessary.  Was there any reason for including it?
> 
> The new functions are defined in usb.h. I have added the include in 
> this file and in the file epautoconf.c that this file includes.  If it is 
> removed from both, then the code does not compile (after make 
> allyesconfig):
> 
> In file included from drivers/usb/gadget/file_storage.c:268:
> drivers/usb/gadget/epautoconf.c: In function 'ep_matches':
> drivers/usb/gadget/epautoconf.c:79: error: implicit declaration of 
> function 'usb_endpoint_type'
> drivers/usb/gadget/epautoconf.c:122: error: implicit declaration of 
> function 'usb_endpoint_dir_in'
> make[1]: *** [drivers/usb/gadget/file_storage.o] Error 1
> make: *** [drivers/usb/gadget/file_storage.o] Error 2
> 
> While putting it in epautoconf.c would be sufficient, the includes
> 
> #include <linux/usb/ch9.h>
> #include <linux/usb/gadget.h>
> 
> are already repeated in both, so it would seem reasonable to repeat usb.h 
> in both as well.

Ah, but the declarations in ch9.h and gadget.h are used by both files, 
whereas the declarations in usb.h are used only by epautoconf.c.  Hence 
it seems most reasonable to #include usb.h only in epautoconf.c.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ