From: Andrew Morton <akpm@osdl.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Linux OMAP Mailing List <linux-omap-open-source@linux.omap.com>,
USB development list <linux-usb-devel@lists.sourceforge.net>
Subject: Re: Invalid Storage Class BUG
Date: Wed, 1 Nov 2006 13:58:13 -0800 [thread overview]
Message-ID: <20061101135813.ae0c960f.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0611011608490.8259-100000@iolanthe.rowland.org>
On Wed, 1 Nov 2006 16:14:01 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:
> On Wed, 1 Nov 2006, Felipe Balbi wrote:
>
> > Hello all,
> >
> > Could anyone help me fix this bug?
> >
> > I couldn't figure out what is happening.
> >
> > Here's the bug:
> > drivers/usb/core/hub.c: In function 'usb_new_device':
> > drivers/usb/core/hub.c:1293: error: invalid storage class for function
> > '__usb_port_suspend'
> > drivers/usb/core/hub.c:1294: warning: implicit declaration of function
> > '__usb_port_suspend'
> > drivers/usb/core/hub.c: At top level:
> > drivers/usb/core/hub.c:1567: error: static declaration of
> > '__usb_port_suspend' follows non-static declaration
> > drivers/usb/core/hub.c:1294: error: previous implicit declaration of
> > '__usb_port_suspend' was here
> > make[3]: *** [drivers/usb/core/hub.o] Error 1
> > make[2]: *** [drivers/usb/core] Error 2
> > make[1]: *** [drivers/usb] Error 2
> > make: *** [drivers] Error 2
>
> Ho, ho!
>
> Andrew, I _told_ you this inner declaration of a static function would
> cause problems!
I thought we fixed that ages ago? What happened to it?
> > Here's the source code:
> >
> > /* Maybe it can talk to us, though we can't talk to it.
> > * (Includes HNP test device.)
> > */
> > if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
> > static int __usb_port_suspend(struct usb_device *,
> > int port1); * (line 1293)*
> > err = __usb_port_suspend(udev,
> > udev->bus->otg_port); * (line 1294)*
> > if (err < 0)
> > dev_dbg(&udev->dev, "HNP fail, %d\n", err);
> > }
> > err = -ENODEV;
> > goto fail;
> > }
>
> The solution is simple. Just take line 1293 (the static function
> declaration) and move it outside of the usb_new_device() function. Stick
> it inside the "#ifdef CONFIG_USB_OTG" block just above the function's
> start.
It'd be better to rearrange things in there so that no forward declarations
are needed. A manual tsort... But whatever. It'd be better if it
compiled ;)
> The problem is that gcc 4 doesn't like static function declarations in
> inner blocks. Earlier versions of gcc didn't mind.
Wanna send a 2.6.19 patch please?
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
next prev parent reply other threads:[~2006-11-01 21:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-01 20:50 Invalid Storage Class BUG Felipe Balbi
2006-11-01 21:14 ` Alan Stern
2006-11-01 21:58 ` Andrew Morton [this message]
2006-11-01 21:32 ` Arnaud Patard
2006-11-01 22:26 ` David Brownell
2006-11-01 22:41 ` Andrew Morton
2006-11-01 22:48 ` David Brownell
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=20061101135813.ae0c960f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-omap-open-source@linux.omap.com \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=stern@rowland.harvard.edu \
/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