Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Fix direction of the loop.



details:   https://anonhg.NetBSD.org/src/rev/32c7ba934aad
branches:  trunk
changeset: 845139:32c7ba934aad
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Sep 20 08:58:25 2019 +0000

description:
Fix direction of the loop.

Found by the lgtm bot.

diffstat:

 sys/dev/ic/i82557.c  |  6 +++---
 sys/dev/pci/if_age.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 44e55a9ac902 -r 32c7ba934aad sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Fri Sep 20 08:48:55 2019 +0000
+++ b/sys/dev/ic/i82557.c       Fri Sep 20 08:58:25 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.154 2019/07/09 08:46:58 msaitoh Exp $     */
+/*     $NetBSD: i82557.c,v 1.155 2019/09/20 09:00:50 maxv Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.154 2019/07/09 08:46:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.155 2019/09/20 09:00:50 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1892,7 +1892,7 @@
        CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->sc_cddma + FXP_CDIASOFF);
        fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
        /* ...and wait for it to complete. */
-       for (i = 1000; i > 0; i++) {
+       for (i = 1000; i > 0; i--) {
                FXP_CDIASSYNC(sc,
                    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                status = le16toh(cb_ias->cb_status);
diff -r 44e55a9ac902 -r 32c7ba934aad sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Fri Sep 20 08:48:55 2019 +0000
+++ b/sys/dev/pci/if_age.c      Fri Sep 20 08:58:25 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_age.c,v 1.60 2019/07/09 08:46:58 msaitoh Exp $ */
+/*     $NetBSD: if_age.c,v 1.61 2019/09/20 08:58:25 maxv Exp $ */
 /*     $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $        */
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60 2019/07/09 08:46:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.61 2019/09/20 08:58:25 maxv Exp $");
 
 #include "vlan.h"
 
@@ -575,7 +575,7 @@
                 */
                CSR_WRITE_4(sc, AGE_TWSI_CTRL, CSR_READ_4(sc, AGE_TWSI_CTRL) |
                    TWSI_CTRL_SW_LD_START);
-               for (i = 100; i > 0; i++) {
+               for (i = 100; i > 0; i--) {
                        DELAY(1000);
                        reg = CSR_READ_4(sc, AGE_TWSI_CTRL);
                        if ((reg & TWSI_CTRL_SW_LD_START) == 0)



Home | Main Index | Thread Index | Old Index