Module Name: src
Committed By: msaitoh
Date: Thu Jul 25 15:06:07 UTC 2019
Modified Files:
src/sys/dev/pci: eap.c
Log Message:
Make register address unsigned to avoid undefined behavior. Found by KUBSan.
To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/eap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/eap.c
diff -u src/sys/dev/pci/eap.c:1.101 src/sys/dev/pci/eap.c:1.102
--- src/sys/dev/pci/eap.c:1.101 Sat Jun 8 08:02:38 2019
+++ src/sys/dev/pci/eap.c Thu Jul 25 15:06:07 2019
@@ -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 void eap1370_set_mixer(struct eap
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 @@ eap1371_src_wait(struct eap_softc *sc)
}
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 @@ eap1371_src_read(struct eap_softc *sc, i
}
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;