Thread (6 messages) 6 messages, 3 authors, 2013-03-29

[PATCH] usb: ehci: mark unlink_empty_async_suspended() as __maybe_unused

From: stern@rowland.harvard.edu (Alan Stern)
Date: 2013-03-29 14:05:07
Also in: lkml

On Thu, 28 Mar 2013, Arnd Bergmann wrote:
Patch 4d053fdac3 "usb: ehci: unlink_empty_async_suspended() only used
with CONFIG_PM" tried to hide the unlink_empty_async_suspended function
inside of an #ifdef to work around an unused function warning.

Unfortunately that had the effect of introducing a new warning:

drivers/usb/host/ehci-q.c:1297:13: warning: 'unlink_empty_async_suspended' 
	declared 'static' but never defined [-Wunused-function]

While we could add another #ifdef around the function declaration to avoid
this, a nicer solution is to mark it as __maybe_unused, which will let
gcc silently drop the function definition when it is not needed.
IMO the compiler is being stupid.  -Wunused-function should warn 
about functions that are defined but not called, not about functions 
that are declared but not defined.  Grumble...

Anyway yes, this is a good fix.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help