linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: core: Remove unused usb_unlink_anchored_urbs
@ 2025-06-08 23:56 linux
  2025-06-09  0:00 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: linux @ 2025-06-08 23:56 UTC (permalink / raw)
  To: gregkh, linux-usb; +Cc: corbet, linux-doc, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

usb_unlink_anchored_urbs() has been unused since it's last use was
removed in 2009 by
commit 9b9c5aaeedfd ("ar9170: xmit code revamp")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 Documentation/driver-api/usb/anchors.rst | 11 ---------
 drivers/usb/core/urb.c                   | 29 +++---------------------
 include/linux/usb.h                      |  1 -
 3 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/Documentation/driver-api/usb/anchors.rst b/Documentation/driver-api/usb/anchors.rst
index 4b248e691bd6..5a93d171e76c 100644
--- a/Documentation/driver-api/usb/anchors.rst
+++ b/Documentation/driver-api/usb/anchors.rst
@@ -45,17 +45,6 @@ This function kills all URBs associated with an anchor. The URBs
 are called in the reverse temporal order they were submitted.
 This way no data can be reordered.
 
-:c:func:`usb_unlink_anchored_urbs`
-----------------------------------
-
-
-This function unlinks all URBs associated with an anchor. The URBs
-are processed in the reverse temporal order they were submitted.
-This is similar to :c:func:`usb_kill_anchored_urbs`, but it will not sleep.
-Therefore no guarantee is made that the URBs have been unlinked when
-the call returns. They may be unlinked later but will be unlinked in
-finite time.
-
 :c:func:`usb_scuttle_anchored_urbs`
 -----------------------------------
 
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 5e52a35486af..0e58a8531d6e 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -597,10 +597,9 @@ EXPORT_SYMBOL_GPL(usb_submit_urb);
  * code).
  *
  * Drivers should not call this routine or related routines, such as
- * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect
- * method has returned.  The disconnect function should synchronize with
- * a driver's I/O routines to insure that all URB-related activity has
- * completed before it returns.
+ * usb_kill_urb(), after their disconnect method has returned. The
+ * disconnect function should synchronize with a driver's I/O routines
+ * to insure that all URB-related activity has completed before it returns.
  *
  * This request is asynchronous, however the HCD might call the ->complete()
  * callback during unlink. Therefore when drivers call usb_unlink_urb(), they
@@ -890,28 +889,6 @@ void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
 	spin_unlock_irqrestore(&anchor->lock, flags);
 }
 EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
-/**
- * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse
- * @anchor: anchor the requests are bound to
- *
- * this allows all outstanding URBs to be unlinked starting
- * from the back of the queue. This function is asynchronous.
- * The unlinking is just triggered. It may happen after this
- * function has returned.
- *
- * This routine should not be called by a driver after its disconnect
- * method has returned.
- */
-void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
-{
-	struct urb *victim;
-
-	while ((victim = usb_get_from_anchor(anchor)) != NULL) {
-		usb_unlink_urb(victim);
-		usb_put_urb(victim);
-	}
-}
-EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs);
 
 /**
  * usb_anchor_suspend_wakeups
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 1b2545b4363b..e8662843e68c 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1780,7 +1780,6 @@ extern void usb_block_urb(struct urb *urb);
 extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
 extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
 extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
-extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
 extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor);
 extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor);
 extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
-- 
2.49.0


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

* Re: [PATCH] usb: core: Remove unused usb_unlink_anchored_urbs
  2025-06-08 23:56 [PATCH] usb: core: Remove unused usb_unlink_anchored_urbs linux
@ 2025-06-09  0:00 ` Randy Dunlap
  2025-06-09  0:29   ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2025-06-09  0:00 UTC (permalink / raw)
  To: linux, gregkh, linux-usb; +Cc: corbet, linux-doc, linux-kernel



On 6/8/25 4:56 PM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> usb_unlink_anchored_urbs() has been unused since it's last use was

s/it's/its/ (same in previous patch's description)

> removed in 2009 by
> commit 9b9c5aaeedfd ("ar9170: xmit code revamp")
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  Documentation/driver-api/usb/anchors.rst | 11 ---------
>  drivers/usb/core/urb.c                   | 29 +++---------------------
>  include/linux/usb.h                      |  1 -
>  3 files changed, 3 insertions(+), 38 deletions(-)
> 
> diff --git a/Documentation/driver-api/usb/anchors.rst b/Documentation/driver-api/usb/anchors.rst
> index 4b248e691bd6..5a93d171e76c 100644
> --- a/Documentation/driver-api/usb/anchors.rst
> +++ b/Documentation/driver-api/usb/anchors.rst
> @@ -45,17 +45,6 @@ This function kills all URBs associated with an anchor. The URBs
>  are called in the reverse temporal order they were submitted.
>  This way no data can be reordered.
>  
> -:c:func:`usb_unlink_anchored_urbs`
> -----------------------------------
> -
> -
> -This function unlinks all URBs associated with an anchor. The URBs
> -are processed in the reverse temporal order they were submitted.
> -This is similar to :c:func:`usb_kill_anchored_urbs`, but it will not sleep.
> -Therefore no guarantee is made that the URBs have been unlinked when
> -the call returns. They may be unlinked later but will be unlinked in
> -finite time.
> -
>  :c:func:`usb_scuttle_anchored_urbs`
>  -----------------------------------
>  
> diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
> index 5e52a35486af..0e58a8531d6e 100644
> --- a/drivers/usb/core/urb.c
> +++ b/drivers/usb/core/urb.c
> @@ -597,10 +597,9 @@ EXPORT_SYMBOL_GPL(usb_submit_urb);
>   * code).
>   *
>   * Drivers should not call this routine or related routines, such as
> - * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect
> - * method has returned.  The disconnect function should synchronize with
> - * a driver's I/O routines to insure that all URB-related activity has
> - * completed before it returns.
> + * usb_kill_urb(), after their disconnect method has returned. The
> + * disconnect function should synchronize with a driver's I/O routines
> + * to insure that all URB-related activity has completed before it returns.
>   *
>   * This request is asynchronous, however the HCD might call the ->complete()
>   * callback during unlink. Therefore when drivers call usb_unlink_urb(), they
> @@ -890,28 +889,6 @@ void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
>  	spin_unlock_irqrestore(&anchor->lock, flags);
>  }
>  EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
> -/**
> - * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse
> - * @anchor: anchor the requests are bound to
> - *
> - * this allows all outstanding URBs to be unlinked starting
> - * from the back of the queue. This function is asynchronous.
> - * The unlinking is just triggered. It may happen after this
> - * function has returned.
> - *
> - * This routine should not be called by a driver after its disconnect
> - * method has returned.
> - */
> -void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
> -{
> -	struct urb *victim;
> -
> -	while ((victim = usb_get_from_anchor(anchor)) != NULL) {
> -		usb_unlink_urb(victim);
> -		usb_put_urb(victim);
> -	}
> -}
> -EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs);
>  
>  /**
>   * usb_anchor_suspend_wakeups
> diff --git a/include/linux/usb.h b/include/linux/usb.h
> index 1b2545b4363b..e8662843e68c 100644
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -1780,7 +1780,6 @@ extern void usb_block_urb(struct urb *urb);
>  extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
>  extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
>  extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
> -extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
>  extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor);
>  extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor);
>  extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);

-- 
~Randy

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

* Re: [PATCH] usb: core: Remove unused usb_unlink_anchored_urbs
  2025-06-09  0:00 ` Randy Dunlap
@ 2025-06-09  0:29   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2025-06-09  0:29 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: gregkh, linux-usb, corbet, linux-doc, linux-kernel

* Randy Dunlap (rdunlap@infradead.org) wrote:
> 
> 
> On 6/8/25 4:56 PM, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > usb_unlink_anchored_urbs() has been unused since it's last use was
> 
> s/it's/its/ (same in previous patch's description)

Oops, I'm terrible for doing that.

> > removed in 2009 by
> > commit 9b9c5aaeedfd ("ar9170: xmit code revamp")
> > 
> > Remove it.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks for the fast ack's.

Dave

> Thanks.
> 
> > ---
> >  Documentation/driver-api/usb/anchors.rst | 11 ---------
> >  drivers/usb/core/urb.c                   | 29 +++---------------------
> >  include/linux/usb.h                      |  1 -
> >  3 files changed, 3 insertions(+), 38 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/usb/anchors.rst b/Documentation/driver-api/usb/anchors.rst
> > index 4b248e691bd6..5a93d171e76c 100644
> > --- a/Documentation/driver-api/usb/anchors.rst
> > +++ b/Documentation/driver-api/usb/anchors.rst
> > @@ -45,17 +45,6 @@ This function kills all URBs associated with an anchor. The URBs
> >  are called in the reverse temporal order they were submitted.
> >  This way no data can be reordered.
> >  
> > -:c:func:`usb_unlink_anchored_urbs`
> > -----------------------------------
> > -
> > -
> > -This function unlinks all URBs associated with an anchor. The URBs
> > -are processed in the reverse temporal order they were submitted.
> > -This is similar to :c:func:`usb_kill_anchored_urbs`, but it will not sleep.
> > -Therefore no guarantee is made that the URBs have been unlinked when
> > -the call returns. They may be unlinked later but will be unlinked in
> > -finite time.
> > -
> >  :c:func:`usb_scuttle_anchored_urbs`
> >  -----------------------------------
> >  
> > diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
> > index 5e52a35486af..0e58a8531d6e 100644
> > --- a/drivers/usb/core/urb.c
> > +++ b/drivers/usb/core/urb.c
> > @@ -597,10 +597,9 @@ EXPORT_SYMBOL_GPL(usb_submit_urb);
> >   * code).
> >   *
> >   * Drivers should not call this routine or related routines, such as
> > - * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect
> > - * method has returned.  The disconnect function should synchronize with
> > - * a driver's I/O routines to insure that all URB-related activity has
> > - * completed before it returns.
> > + * usb_kill_urb(), after their disconnect method has returned. The
> > + * disconnect function should synchronize with a driver's I/O routines
> > + * to insure that all URB-related activity has completed before it returns.
> >   *
> >   * This request is asynchronous, however the HCD might call the ->complete()
> >   * callback during unlink. Therefore when drivers call usb_unlink_urb(), they
> > @@ -890,28 +889,6 @@ void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
> >  	spin_unlock_irqrestore(&anchor->lock, flags);
> >  }
> >  EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
> > -/**
> > - * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse
> > - * @anchor: anchor the requests are bound to
> > - *
> > - * this allows all outstanding URBs to be unlinked starting
> > - * from the back of the queue. This function is asynchronous.
> > - * The unlinking is just triggered. It may happen after this
> > - * function has returned.
> > - *
> > - * This routine should not be called by a driver after its disconnect
> > - * method has returned.
> > - */
> > -void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
> > -{
> > -	struct urb *victim;
> > -
> > -	while ((victim = usb_get_from_anchor(anchor)) != NULL) {
> > -		usb_unlink_urb(victim);
> > -		usb_put_urb(victim);
> > -	}
> > -}
> > -EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs);
> >  
> >  /**
> >   * usb_anchor_suspend_wakeups
> > diff --git a/include/linux/usb.h b/include/linux/usb.h
> > index 1b2545b4363b..e8662843e68c 100644
> > --- a/include/linux/usb.h
> > +++ b/include/linux/usb.h
> > @@ -1780,7 +1780,6 @@ extern void usb_block_urb(struct urb *urb);
> >  extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
> >  extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
> >  extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
> > -extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
> >  extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor);
> >  extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor);
> >  extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
> 
> -- 
> ~Randy
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

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

end of thread, other threads:[~2025-06-09  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 23:56 [PATCH] usb: core: Remove unused usb_unlink_anchored_urbs linux
2025-06-09  0:00 ` Randy Dunlap
2025-06-09  0:29   ` Dr. David Alan Gilbert

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