Remove feature creep: STAILQ_REMOVE_HEAD_UNTIL added it for convenience

but we can do without it.
This commit is contained in:
Nick Hibma 1999-04-20 22:37:18 +00:00
parent 1d8ca40c41
commit 38a3a046fc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45887
3 changed files with 17 additions and 6 deletions

View File

@ -1040,7 +1040,11 @@ usb_start_next(pipe)
#endif
/* First remove remove old */
#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, SIMPLEQ_FIRST(&pipe->queue), next);
#elif defined(__FreeBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
#endif
if (pipe->state != USBD_PIPE_ACTIVE) {
pipe->running = 0;
return;

View File

@ -261,7 +261,11 @@ usbd_alloc_request()
reqh = SIMPLEQ_FIRST(&usbd_free_requests);
if (reqh)
#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, reqh, next);
#elif defined(__FreeBSD__)
SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, next);
#endif
else
reqh = malloc(sizeof(*reqh), M_USB, M_NOWAIT);
if (!reqh)
@ -918,7 +922,11 @@ usbd_ar_pipe(pipe)
reqh = SIMPLEQ_FIRST(&pipe->queue);
if (reqh == 0)
break;
#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
#elif defined(__FreeBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
#endif
reqh->status = USBD_CANCELLED;
if (reqh->callback)
reqh->callback(reqh, reqh->priv, reqh->status);
@ -926,7 +934,11 @@ usbd_ar_pipe(pipe)
#else
while ((reqh = SIMPLEQ_FIRST(&pipe->queue))) {
pipe->methods->abort(reqh);
#if defined(__NetBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
#elif defined(__FreeBSD__)
SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
#endif
}
#endif
return (USBD_NORMAL_COMPLETION);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
* $Id: queue.h,v 1.23 1999/01/06 20:03:11 n_hibma Exp $
* $Id: queue.h,v 1.24 1999/01/07 22:27:53 n_hibma Exp $
*/
#ifndef _SYS_QUEUE_H_
@ -218,11 +218,6 @@ struct { \
(head)->stqh_last = &(head)->stqh_first; \
} while (0)
#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
(head)->stqh_last = &(head)->stqh_first; \
} while (0)
#define STAILQ_REMOVE(head, elm, type, field) do { \
if ((head)->stqh_first == (elm)) { \