linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static
@ 2016-09-23 13:46 Baoyou Xie
  2016-09-23 15:08 ` Greg KH
  2016-09-26  9:59 ` Mathias Nyman
  0 siblings, 2 replies; 4+ messages in thread
From: Baoyou Xie @ 2016-09-23 13:46 UTC (permalink / raw)
  To: mathias.nyman, gregkh
  Cc: linux-usb, linux-kernel, arnd, baoyou.xie, xie.baoyou, xie.baoyou

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(-)

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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static
  2016-09-23 13:46 [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static Baoyou Xie
@ 2016-09-23 15:08 ` Greg KH
  2016-09-23 16:02   ` Arnd Bergmann
  2016-09-26  9:59 ` Mathias Nyman
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2016-09-23 15:08 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: mathias.nyman, linux-usb, linux-kernel, arnd, xie.baoyou,
	xie.baoyou

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'.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static
  2016-09-23 15:08 ` Greg KH
@ 2016-09-23 16:02   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-09-23 16:02 UTC (permalink / raw)
  To: Greg KH
  Cc: Baoyou Xie, mathias.nyman, linux-usb, linux-kernel, xie.baoyou,
	xie.baoyou

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static
  2016-09-23 13:46 [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static Baoyou Xie
  2016-09-23 15:08 ` Greg KH
@ 2016-09-26  9:59 ` Mathias Nyman
  1 sibling, 0 replies; 4+ messages in thread
From: Mathias Nyman @ 2016-09-26  9:59 UTC (permalink / raw)
  To: Baoyou Xie, mathias.nyman, gregkh
  Cc: linux-usb, linux-kernel, arnd, xie.baoyou, xie.baoyou

On 23.09.2016 16:46, 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'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
>   drivers/usb/host/xhci-ring.c | 5 +++--

Hi

There's a similar patch already pending, I'm sending that one
forward after rc1 is out

http://marc.info/?l=linux-usb&m=147170676714500&w=2

-Mathias

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-26  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-23 13:46 [PATCH] usb: xhci: mark xhci_unmap_td_bounce_buffer() static Baoyou Xie
2016-09-23 15:08 ` Greg KH
2016-09-23 16:02   ` Arnd Bergmann
2016-09-26  9:59 ` Mathias Nyman

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).