From 1e30ecb1d36682cdc77b1b8cd916dde41178a69d Mon Sep 17 00:00:00 2001 From: sf Date: Sat, 18 Apr 2015 14:38:38 +0000 Subject: [PATCH] Simplify vio_encap() a bit. From brad@ --- sys/dev/pci/if_vio.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/pci/if_vio.c b/sys/dev/pci/if_vio.c index 4a4c09015e1..120b2607351 100644 --- a/sys/dev/pci/if_vio.c +++ b/sys/dev/pci/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.26 2015/04/07 19:31:42 sf Exp $ */ +/* $OpenBSD: if_vio.c,v 1.27 2015/04/18 14:38:38 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -1152,19 +1152,17 @@ vio_encap(struct vio_softc *sc, int slot, struct mbuf *m) case 0: break; case EFBIG: - if ((r = m_defrag(m, M_DONTWAIT)) == 0 && - (r = bus_dmamap_load_mbuf(vsc->sc_dmat, dmap, m, - BUS_DMA_WRITE|BUS_DMA_NOWAIT)) == 0) + if (m_defrag(m, M_DONTWAIT) == 0 && + bus_dmamap_load_mbuf(vsc->sc_dmat, dmap, m, + BUS_DMA_WRITE|BUS_DMA_NOWAIT) == 0) break; /* FALLTHROUGH */ default: - printf("%s: tx dmamap load error %d\n", sc->sc_dev.dv_xname, - r); return ENOBUFS; } sc->sc_tx_mbufs[slot] = m; - return r; + return 0; } /* free all the mbufs already put on vq; called from if_stop(disable) */ -- 2.20.1