Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/virtio viocon(4): Show error in assertion failure.



details:   https://anonhg.NetBSD.org/src/rev/db46fc1851d4
branches:  trunk
changeset: 374278:db46fc1851d4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 16 18:37:16 2023 +0000

description:
viocon(4): Show error in assertion failure.

diffstat:

 sys/dev/virtio/viocon.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 085f7403cde5 -r db46fc1851d4 sys/dev/virtio/viocon.c
--- a/sys/dev/virtio/viocon.c   Sun Apr 16 17:57:08 2023 +0000
+++ b/sys/dev/virtio/viocon.c   Sun Apr 16 18:37:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: viocon.c,v 1.8 2023/03/23 03:55:11 yamaguchi Exp $     */
+/*     $NetBSD: viocon.c,v 1.9 2023/04/16 18:37:16 riastradh Exp $     */
 /*     $OpenBSD: viocon.c,v 1.8 2021/11/05 11:38:29 mpi Exp $  */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.8 2023/03/23 03:55:11 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.9 2023/04/16 18:37:16 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -377,7 +377,7 @@ viocon_rx_fill(struct viocon_port *vp)
                virtio_enqueue_commit(vsc, vq, slot, 0);
                ndone++;
        }
-       KASSERT(r == 0 || r == EAGAIN);
+       KASSERTMSG(r == 0 || r == EAGAIN, "r=%d", r);
        if (ndone > 0)
                virtio_notify(vsc, vq);
 }
@@ -453,9 +453,9 @@ vioconstart(struct tty *tp)
                        SET(tp->t_state, TS_BUSY);
                        break;
                }
-               KASSERT(ret == 0);
+               KASSERTMSG(ret == 0, "ret=%d", ret);
                ret = virtio_enqueue_reserve(vsc, vq, slot, 1);
-               KASSERT(ret == 0);
+               KASSERTMSG(ret == 0, "ret=%d", ret);
                buf = vp->vp_tx_buf + slot * BUFSIZE;
                cnt = q_to_b(&tp->t_outq, buf, BUFSIZE);
                bus_dmamap_sync(virtio_dmat(vsc), vp->vp_dmamap,



Home | Main Index | Thread Index | Old Index