diff mbox

usb: xhci: mark xhci_unmap_td_bounce_buffer() static

Message ID 1474638373-27342-1-git-send-email-baoyou.xie@linaro.org
State New
Headers show

Commit Message

Baoyou Xie Sept. 23, 2016, 1:46 p.m. UTC
We get 1 warning when building kernel with W=1:
drivers/usb/host/xhci-ring.c:608:6: warning: no previous prototype for 'xhci_unmap_td_bounce_buffer' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
so this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>

---
 drivers/usb/host/xhci-ring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Arnd Bergmann Sept. 23, 2016, 4:02 p.m. UTC | #1
On Friday, September 23, 2016 5:08:37 PM CEST Greg KH wrote:
> On Fri, Sep 23, 2016 at 09:46:13PM +0800, Baoyou Xie wrote:

> > We get 1 warning when building kernel with W=1:

> > drivers/usb/host/xhci-ring.c:608:6: warning: no previous prototype for 'xhci_unmap_td_bounce_buffer' [-Wmissing-prototypes]

> > 

> > In fact, this function is only used in the file in which it is

> > declared and don't need a declaration, but can be made static.

> > so this patch marks this function with 'static'.

> 

> Any reason you aren't using sparse for all of these 'static' functions

> you are finding?  It should be easier than using 'W=1'.


It was my idea, I suggest to Baoyou to enable the warning standalone
and fix all instances he finds, so we can eventually enable it by default
for everyone. Once that is in place, we won't even need to use sparse
any more. I suspect it will take a while before all of his patches are
merged upstream, but IIRC he has sent almost all the ones needed for
an arm "allmodconfig" build now, and a lot have been accepted.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 797137e..9cf70c9 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -605,8 +605,9 @@  static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
 	}
 }
 
-void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci, struct xhci_ring *ring,
-				 struct xhci_td *td)
+static void
+xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci, struct xhci_ring *ring,
+			    struct xhci_td *td)
 {
 	struct device *dev = xhci_to_hcd(xhci)->self.controller;
 	struct xhci_segment *seg = td->bounce_seg;