Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/samsung Fix a stupid bug in exynos*_clock_set_r...



details:   https://anonhg.NetBSD.org/src/rev/d9f3ff1e1c45
branches:  trunk
changeset: 320356:d9f3ff1e1c45
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Jul 02 20:24:55 2018 +0000

description:
Fix a stupid bug in exynos*_clock_set_rate_div

diffstat:

 sys/arch/arm/samsung/exynos5410_clock.c |  6 +++---
 sys/arch/arm/samsung/exynos5422_clock.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r dcaa9c8e958c -r d9f3ff1e1c45 sys/arch/arm/samsung/exynos5410_clock.c
--- a/sys/arch/arm/samsung/exynos5410_clock.c   Mon Jul 02 17:50:02 2018 +0000
+++ b/sys/arch/arm/samsung/exynos5410_clock.c   Mon Jul 02 20:24:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos5410_clock.c,v 1.2 2017/06/20 17:43:51 skrll Exp $ */
+/* $NetBSD: exynos5410_clock.c,v 1.3 2018/07/02 20:24:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.2 2017/06/20 17:43:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.3 2018/07/02 20:24:55 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -669,7 +669,7 @@
        clk_parent = exynos5410_clock_get_parent(sc, &eclk->base);
        const u_int parent_rate = exynos5410_clock_get_rate(sc, clk_parent);
 
-       for (tmp_div = 0; tmp_div < popcount32(ediv->bits); tmp_div++) {
+       for (tmp_div = 0; tmp_div < __SHIFTOUT_MASK(ediv->bits); tmp_div++) {
                tmp_rate = parent_rate / (tmp_div + 1);
                if (tmp_rate <= rate) {
                        new_div = tmp_div;
diff -r dcaa9c8e958c -r d9f3ff1e1c45 sys/arch/arm/samsung/exynos5422_clock.c
--- a/sys/arch/arm/samsung/exynos5422_clock.c   Mon Jul 02 17:50:02 2018 +0000
+++ b/sys/arch/arm/samsung/exynos5422_clock.c   Mon Jul 02 20:24:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos5422_clock.c,v 1.6 2017/06/19 21:59:55 jmcneill Exp $ */
+/* $NetBSD: exynos5422_clock.c,v 1.7 2018/07/02 20:24:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.6 2017/06/19 21:59:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.7 2018/07/02 20:24:55 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -747,7 +747,7 @@
        clk_parent = exynos5422_clock_get_parent(sc, &eclk->base);
        const u_int parent_rate = exynos5422_clock_get_rate(sc, clk_parent);
 
-       for (tmp_div = 0; tmp_div < popcount32(ediv->bits); tmp_div++) {
+       for (tmp_div = 0; tmp_div < __SHIFTOUT_MASK(ediv->bits); tmp_div++) {
                tmp_rate = parent_rate / (tmp_div + 1);
                if (tmp_rate <= rate) {
                        new_div = tmp_div;



Home | Main Index | Thread Index | Old Index