Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/asm memset_io works with bytes...



details:   https://anonhg.NetBSD.org/src/rev/49b929bc0d91
branches:  trunk
changeset: 968477:49b929bc0d91
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jan 18 02:42:23 2020 +0000

description:
memset_io works with bytes not dwords, noted by riastradh@

diffstat:

 sys/external/bsd/drm2/include/asm/io.h |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (27 lines):

diff -r a194d9235f02 -r 49b929bc0d91 sys/external/bsd/drm2/include/asm/io.h
--- a/sys/external/bsd/drm2/include/asm/io.h    Fri Jan 17 22:03:56 2020 +0000
+++ b/sys/external/bsd/drm2/include/asm/io.h    Sat Jan 18 02:42:23 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.h,v 1.5 2020/01/17 20:28:59 jmcneill Exp $  */
+/*     $NetBSD: io.h,v 1.6 2020/01/18 02:42:23 jmcneill Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,12 +51,13 @@
 static inline void *
 memset_io(void *b, int c, size_t len)
 {
-       uint32_t *ptr = b;
-       while (len >= 4) {
+       uint8_t *ptr = b;
+
+       while (len > 0) {
                *ptr++ = c;
-               len -= 4;
+               len--;
        }
-       KASSERT(len == 0);
+
        return b;
 }
 #else



Home | Main Index | Thread Index | Old Index