Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/cortex Fix loop to calculate prescaler divisor.



details:   https://anonhg.NetBSD.org/src/rev/5205e8c6171b
branches:  trunk
changeset: 1000593:5205e8c6171b
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Jul 30 06:57:02 2019 +0000

description:
Fix loop to calculate prescaler divisor.

diffstat:

 sys/arch/arm/cortex/a9wdt.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0760b44c0214 -r 5205e8c6171b sys/arch/arm/cortex/a9wdt.c
--- a/sys/arch/arm/cortex/a9wdt.c       Tue Jul 30 06:52:57 2019 +0000
+++ b/sys/arch/arm/cortex/a9wdt.c       Tue Jul 30 06:57:02 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: a9wdt.c,v 1.7 2017/12/29 11:07:03 skrll Exp $  */
+/*     $NetBSD: a9wdt.c,v 1.8 2019/07/30 06:57:02 skrll Exp $  */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.7 2017/12/29 11:07:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.8 2019/07/30 06:57:02 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -214,7 +214,7 @@
                /*
                 * Let's hope the timer frequency isn't prime.
                 */
-               for (size_t div = 256; div >= 2; div++) {
+               for (size_t div = 256; div >= 2; div--) {
                        if (sc->sc_freq % div == 0) {
                                sc->sc_wdog_prescaler = div;
                                break;



Home | Main Index | Thread Index | Old Index