From: Sarah Sharp <sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Greg KH <gregkh-l3A5Bk7waGM@public.gmane.org>,
Randy Dunlap
<randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Stephen Rothwell <sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>,
linux-next-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
lud <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Andiry Xu <andiry.xu-5C7GfCeVMHo@public.gmane.org>,
Dong Nguyen <dong.nguyen-5C7GfCeVMHo@public.gmane.org>,
Libin Yang <libin.yang-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] usb: Fix linker errors with CONFIG_PM=n
Date: Fri, 15 Oct 2010 16:26:29 -0700 [thread overview]
Message-ID: <20101015232629.GA26031@xanatos> (raw)
In-Reply-To: <20101015222301.GA4080-OI9uyE9O0yo@public.gmane.org>
On Sat, Oct 16, 2010 at 12:23:01AM +0200, Marcin Slusarz wrote:
> On Fri, Oct 15, 2010 at 02:59:15PM -0700, Sarah Sharp wrote:
> > diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> > index c08928a..93d3bf4 100644
> > --- a/drivers/usb/host/xhci.h
> > +++ b/drivers/usb/host/xhci.h
> > @@ -1405,8 +1405,15 @@ int xhci_init(struct usb_hcd *hcd);
> > int xhci_run(struct usb_hcd *hcd);
> > void xhci_stop(struct usb_hcd *hcd);
> > void xhci_shutdown(struct usb_hcd *hcd);
> > +
> > +#ifdef CONFIG_PM
> > int xhci_suspend(struct xhci_hcd *xhci);
> > int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
> > +#else
> > +#define xhci_suspend NULL
> > +#define xhci_resume NULL
> > +#endif
> > +
>
> "static inline int xhci_suspend(struct xhci_hcd *) {}"
> has the same effect but saves types
That doesn't have the same effect. Since those functions are only used
as function pointers, the original patch compiles to less code when
CONFIG_PM=n. Also, the original version will cause an oops if those
functions are ever called when CONFIG_PM=n, which would indicate a bug
in the callee (something we would rather catch anyway). This is the
style that other USB host controller drivers use, like EHCI.
I don't understand what you mean by "saves types". Is there something
I've missed?
Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-10-15 23:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-15 5:50 linux-next: Tree for October 15 Stephen Rothwell
2010-10-15 15:44 ` linux-next: Tree for October 15 (usb/xhci) Randy Dunlap
[not found] ` <20101015084420.6624796d.randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2010-10-15 16:48 ` Greg KH
2010-10-15 17:52 ` Sarah Sharp
2010-10-15 18:16 ` Greg KH
2010-10-15 18:24 ` [PATCH] xhci: Fix compile error when CONFIG_PM=n Sarah Sharp
2010-10-15 20:02 ` Randy Dunlap
2010-10-15 20:57 ` Sarah Sharp
2010-10-15 21:59 ` [PATCH] usb: Fix linker errors with CONFIG_PM=n Sarah Sharp
2010-10-15 22:23 ` Marcin Slusarz
[not found] ` <20101015222301.GA4080-OI9uyE9O0yo@public.gmane.org>
2010-10-15 23:26 ` Sarah Sharp [this message]
2010-10-16 11:35 ` Marcin Slusarz
2010-10-15 23:27 ` Randy Dunlap
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=20101015232629.GA26031@xanatos \
--to=sarah.a.sharp-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=andiry.xu-5C7GfCeVMHo@public.gmane.org \
--cc=dong.nguyen-5C7GfCeVMHo@public.gmane.org \
--cc=gregkh-l3A5Bk7waGM@public.gmane.org \
--cc=libin.yang-5C7GfCeVMHo@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-next-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).