Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Make register address unsigned to avoid undefine...



details:   https://anonhg.NetBSD.org/src/rev/880bbcf7875c
branches:  trunk
changeset: 842847:880bbcf7875c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Jul 25 15:06:07 2019 +0000

description:
Make register address unsigned to avoid undefined behavior. Found by KUBSan.

diffstat:

 sys/dev/pci/eap.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (47 lines):

diff -r 79c5e3b05331 -r 880bbcf7875c sys/dev/pci/eap.c
--- a/sys/dev/pci/eap.c Thu Jul 25 14:31:35 2019 +0000
+++ b/sys/dev/pci/eap.c Thu Jul 25 15:06:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eap.c,v 1.101 2019/06/08 08:02:38 isaki Exp $  */
+/*     $NetBSD: eap.c,v 1.102 2019/07/25 15:06:07 msaitoh Exp $        */
 /*      $OpenBSD: eap.c,v 1.6 1999/10/05 19:24:42 csapuntz Exp $ */
 
 /*
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.101 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.102 2019/07/25 15:06:07 msaitoh Exp $");
 
 #include "midi.h"
 #include "joy_eap.h"
@@ -138,8 +138,8 @@
 static uint32_t eap1371_src_wait(struct eap_softc *);
 static void    eap1371_set_adc_rate(struct eap_softc *, int);
 static void    eap1371_set_dac_rate(struct eap_instance *, int);
-static int     eap1371_src_read(struct eap_softc *, int);
-static void    eap1371_src_write(struct eap_softc *, int, int);
+static int     eap1371_src_read(struct eap_softc *, u_int);
+static void    eap1371_src_write(struct eap_softc *, u_int, int);
 static int     eap1371_query_devinfo(void *, mixer_devinfo_t *);
 
 static int     eap1371_attach_codec(void *, struct ac97_codec_if *);
@@ -382,7 +382,7 @@
 }
 
 static int
-eap1371_src_read(struct eap_softc *sc, int a)
+eap1371_src_read(struct eap_softc *sc, u_int a)
 {
        int to;
        uint32_t src, t;
@@ -407,7 +407,7 @@
 }
 
 static void
-eap1371_src_write(struct eap_softc *sc, int a, int d)
+eap1371_src_write(struct eap_softc *sc, u_int a, int d)
 {
        uint32_t r;
 



Home | Main Index | Thread Index | Old Index