Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/marvell Correct locks and missing breaks.



details:   https://anonhg.NetBSD.org/src/rev/773f4e6180aa
branches:  trunk
changeset: 343535:773f4e6180aa
user:      hikaru <hikaru%NetBSD.org@localhost>
date:      Sat Feb 13 03:33:02 2016 +0000

description:
Correct locks and missing breaks.

diffstat:

 sys/dev/marvell/if_mvxpe.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (75 lines):

diff -r e30d75b339d8 -r 773f4e6180aa sys/dev/marvell/if_mvxpe.c
--- a/sys/dev/marvell/if_mvxpe.c        Fri Feb 12 17:23:21 2016 +0000
+++ b/sys/dev/marvell/if_mvxpe.c        Sat Feb 13 03:33:02 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvxpe.c,v 1.3 2016/02/09 08:32:11 ozaki-r Exp $     */
+/*     $NetBSD: if_mvxpe.c,v 1.4 2016/02/13 03:33:02 hikaru Exp $      */
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.3 2016/02/09 08:32:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.4 2016/02/13 03:33:02 hikaru Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -850,7 +850,6 @@
                        aprint_error_ifnet(ifp,
                            "initialization failed: cannot initialize queue\n");
                        mvxpe_rx_unlockq(sc, q);
-                       mvxpe_tx_unlockq(sc, q);
                        return ENOBUFS;
                }
                mvxpe_rx_unlockq(sc, q);
@@ -859,7 +858,6 @@
                if (mvxpe_tx_queue_init(ifp, q) != 0) {
                        aprint_error_ifnet(ifp,
                            "initialization failed: cannot initialize queue\n");
-                       mvxpe_rx_unlockq(sc, q);
                        mvxpe_tx_unlockq(sc, q);
                        return ENOBUFS;
                }
@@ -1421,8 +1419,10 @@
 
        mvxpe_sc_lock(sc);
        ic = MVXPE_READ(sc, MVXPE_PRXTXTIC);
-       if (ic == 0)
+       if (ic == 0) {
+               mvxpe_sc_unlock(sc);
                return 0;
+       }
        MVXPE_WRITE(sc, MVXPE_PRXTXTIC, ~ic);
        datum = datum ^ ic;
 
@@ -1441,8 +1441,10 @@
                DPRINTIFNET(ifp, 2, "PTXTXTIC: +PRXTXICSUMMARY\n");
                mvxpe_rxtx_intr(sc);
        }
-       if (!(ifp->if_flags & IFF_RUNNING))
+       if (!(ifp->if_flags & IFF_RUNNING)) {
+               mvxpe_sc_unlock(sc);
                return 1;
+       }
 
        /* RxTxTH interrupt */
        queues = MVXPE_PRXTXTI_GET_RBICTAPQ(ic);
@@ -2316,12 +2318,16 @@
                        switch (t->flags & MVXPE_TX_F_EC_MASK) {
                        case MVXPE_TX_F_EC_LC:
                                MVXPE_EVCNT_INCR(&sc->sc_ev.ev_txd_lc);
+                               break;
                        case MVXPE_TX_F_EC_UR:
                                MVXPE_EVCNT_INCR(&sc->sc_ev.ev_txd_ur);
+                               break;
                        case MVXPE_TX_F_EC_RL:
                                MVXPE_EVCNT_INCR(&sc->sc_ev.ev_txd_rl);
+                               break;
                        default:
                                MVXPE_EVCNT_INCR(&sc->sc_ev.ev_txd_oth);
+                               break;
                        }
                        error = 1;
                }



Home | Main Index | Thread Index | Old Index