Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Simplify some branches and kassert some redundan...
details: https://anonhg.NetBSD.org/src/rev/8dd203db0d4d
branches: trunk
changeset: 745142:8dd203db0d4d
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Feb 23 08:54:55 2020 +0000
description:
Simplify some branches and kassert some redundant assignments.
diffstat:
sys/dev/usb/motg.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diffs (58 lines):
diff -r df06b5f75897 -r 8dd203db0d4d sys/dev/usb/motg.c
--- a/sys/dev/usb/motg.c Sun Feb 23 08:54:47 2020 +0000
+++ b/sys/dev/usb/motg.c Sun Feb 23 08:54:55 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: motg.c,v 1.32 2020/02/23 08:54:47 riastradh Exp $ */
+/* $NetBSD: motg.c,v 1.33 2020/02/23 08:54:55 riastradh Exp $ */
/*
* Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.32 2020/02/23 08:54:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.33 2020/02/23 08:54:55 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1284,7 +1284,7 @@
/* Insert last in queue. */
mutex_enter(&sc->sc_lock);
err = usb_insert_transfer(xfer);
- xfer->ux_status = USBD_NOT_STARTED;
+ KASSERT(xfer->ux_status == USBD_NOT_STARTED);
mutex_exit(&sc->sc_lock);
if (err)
return err;
@@ -1304,9 +1304,7 @@
mutex_enter(&sc->sc_lock);
err = motg_device_ctrl_start1(sc);
mutex_exit(&sc->sc_lock);
- if (err != USBD_IN_PROGRESS)
- return err;
- return USBD_IN_PROGRESS;
+ return err;
}
static usbd_status
@@ -1741,7 +1739,7 @@
mutex_enter(&sc->sc_lock);
DPRINTF("xfer %#jx status %jd", (uintptr_t)xfer, xfer->ux_status, 0, 0);
err = usb_insert_transfer(xfer);
- xfer->ux_status = USBD_NOT_STARTED;
+ KASSERT(xfer->ux_status == USBD_NOT_STARTED);
mutex_exit(&sc->sc_lock);
if (err)
return err;
@@ -1766,9 +1764,7 @@
DPRINTF("xfer %#jx status %jd", (uintptr_t)xfer, xfer->ux_status, 0, 0);
err = motg_device_data_start1(sc, otgpipe->hw_ep);
mutex_exit(&sc->sc_lock);
- if (err != USBD_IN_PROGRESS)
- return err;
- return USBD_IN_PROGRESS;
+ return err;
}
static usbd_status
Home |
Main Index |
Thread Index |
Old Index