linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Cohen <david.a.cohen@linux.intel.com>
To: pavel@ucw.cz, rjw@rjwysocki.net, len.brown@intel.com,
	sarah.a.sharp@linux.intel.com, gregkh@linuxfoundation.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, santosh.shilimkar@ti.com,
	David Cohen <david.a.cohen@linux.intel.com>
Subject: [RFC/PATCH 2/3] usb/xhci: implement proper static inline stubs when !CONFIG_PM
Date: Thu, 12 Dec 2013 21:18:24 -0800	[thread overview]
Message-ID: <1386911905-2366-3-git-send-email-david.a.cohen@linux.intel.com> (raw)
In-Reply-To: <1386911905-2366-1-git-send-email-david.a.cohen@linux.intel.com>

Current xhci_suspend() and xhci_resume() implementation in case of
CONFIG_PM not defined is buggy. If we try to use them we get the
following error:

drivers/usb/host/xhci-plat.c: In function ‘xhci_plat_suspend’:
drivers/usb/host/xhci-plat.c:205:21: error: called object ‘0u’ is not a function
drivers/usb/host/xhci-plat.c: In function ‘xhci_plat_resume’:
drivers/usb/host/xhci-plat.c:213:20: error: called object ‘0u’ is not a function

It happens because the function names are replaced by NULL but the
brackets stay: NULL()

This patch implements proper static inline stubs.

Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
---
 drivers/usb/host/xhci.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 941d5f59e4dc..6a5e7a98de7e 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1771,8 +1771,10 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
 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
+static inline int
+xhci_suspend(struct xhci_hcd *xhci) { return 0; }
+static inline int
+xhci_resume(struct xhci_hcd *xhci, bool hibernated) { return 0; }
 #endif
 
 int xhci_get_frame(struct usb_hcd *hcd);
-- 
1.8.4.2

  parent reply	other threads:[~2013-12-13  5:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13  5:18 [RFC/PATCH 0/3] pm: Make SET_*_PM_OPS() macros more smart David Cohen
2013-12-13  5:18 ` [RFC/PATCH 1/3] pm: make PM " David Cohen
2013-12-15 17:51   ` Pavel Machek
2013-12-15 19:25     ` David Cohen
2013-12-20 19:55       ` Pavel Machek
2013-12-20 20:23         ` David Cohen
2014-01-14 22:42           ` David Cohen
2014-01-22 21:21             ` David Cohen
2013-12-13  5:18 ` David Cohen [this message]
2013-12-13  5:18 ` [RFC/PATCH 3/3] usb/xhci-plat: remove unnecessary #ifdef checks for CONFIG_PM_SLEEP David Cohen
2013-12-13  8:19   ` Ulf Hansson
2013-12-13 15:46     ` David Cohen
     [not found] ` <1386911905-2366-1-git-send-email-david.a.cohen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-12-19  5:12   ` [RFC/PATCH 0/3] pm: Make SET_*_PM_OPS() macros more smart David Cohen

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=1386911905-2366-3-git-send-email-david.a.cohen@linux.intel.com \
    --to=david.a.cohen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=santosh.shilimkar@ti.com \
    --cc=sarah.a.sharp@linux.intel.com \
    /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).