git: cd9810f00e57 - stable/15 - sound: Use unsigned long instead of legacy u_long

Christos Margiolis <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a84b3d0.1cf2a.126a4b31__11359.180374869$1787081700$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=cd9810f00e5722f6487fbc763c46390357133921

commit cd9810f00e5722f6487fbc763c46390357133921
Author:     Christos Margiolis <[email protected]>
AuthorDate: 2026-08-11 18:35:27 +0000
Commit:     Christos Margiolis <[email protected]>
CommitDate: 2026-08-18 19:34:31 +0000

    sound: Use unsigned long instead of legacy u_long
    
    No functional change intended.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    
    (cherry picked from commit afe56ee24679d6584acf02dd17f6ed52c052abe7)
---
 sys/dev/sound/midi/midi.c   |  2 +-
 sys/dev/sound/pci/csa.c     | 22 ++++++++++++----------
 sys/dev/sound/pci/csamidi.c |  4 ++--
 sys/dev/sound/pci/csapcm.c  | 43 ++++++++++++++++++++++---------------------
 sys/dev/sound/pci/csavar.h  | 12 ++++++------
 sys/dev/sound/pci/vibes.c   |  5 +++--
 sys/dev/sound/pcm/buffer.c  |  5 +++--
 sys/dev/sound/pcm/dsp.c     |  6 +++---
 sys/dev/sound/pcm/mixer.c   |  4 ++--
 sys/dev/sound/pcm/mixer.h   |  3 ++-
 sys/dev/sound/sndstat.c     |  4 ++--
 sys/dev/sound/usb/uaudio.c  |  5 +++--
 12 files changed, 61 insertions(+), 54 deletions(-)

diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c
index e70f76a44ed9..c2307b659a43 100644
--- a/sys/dev/sound/midi/midi.c
+++ b/sys/dev/sound/midi/midi.c
@@ -483,7 +483,7 @@ err0:	return retval;
 }
 
 int
-midi_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode,
+midi_ioctl(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode,
     struct thread *td)
 {
 	return ENXIO;
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index 515efd304c35..ec1f0fb1a468 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -92,7 +92,8 @@ static int csa_teardown_intr(device_t bus, device_t child,
 static driver_intr_t csa_intr;
 static int csa_initialize(sc_p scp);
 static int csa_downloadimage(csa_res *resp);
-static int csa_transferimage(csa_res *resp, uint32_t *src, u_long dest, u_long len);
+static int csa_transferimage(csa_res *resp, uint32_t *src, unsigned long dest,
+    unsigned long len);
 
 static void
 amp_none(void)
@@ -807,7 +808,7 @@ static int
 csa_downloadimage(csa_res *resp)
 {
 	int ret;
-	u_long ul, offset;
+	unsigned long ul, offset;
 
 	for (ul = 0, offset = 0 ; ul < INKY_MEMORY_COUNT ; ul++) {
 	        /*
@@ -826,9 +827,10 @@ csa_downloadimage(csa_res *resp)
 }
 
 static int
-csa_transferimage(csa_res *resp, uint32_t *src, u_long dest, u_long len)
+csa_transferimage(csa_res *resp, uint32_t *src, unsigned long dest,
+    unsigned long len)
 {
-	u_long ul;
+	unsigned long ul;
 
 	/*
 	 * We do not allow DMAs from host memory to host memory (although the DMA
@@ -850,7 +852,7 @@ csa_transferimage(csa_res *resp, uint32_t *src, u_long dest, u_long len)
 }
 
 int
-csa_readcodec(csa_res *resp, u_long offset, uint32_t *data)
+csa_readcodec(csa_res *resp, unsigned long offset, uint32_t *data)
 {
 	int i;
 	uint32_t acctl, acsts;
@@ -944,7 +946,7 @@ csa_readcodec(csa_res *resp, u_long offset, uint32_t *data)
 }
 
 int
-csa_writecodec(csa_res *resp, u_long offset, uint32_t data)
+csa_writecodec(csa_res *resp, unsigned long offset, uint32_t data)
 {
 	int i;
 	uint32_t acctl;
@@ -997,7 +999,7 @@ csa_writecodec(csa_res *resp, u_long offset, uint32_t data)
 }
 
 uint32_t
-csa_readio(csa_res *resp, u_long offset)
+csa_readio(csa_res *resp, unsigned long offset)
 {
 	uint32_t ul;
 
@@ -1011,7 +1013,7 @@ csa_readio(csa_res *resp, u_long offset)
 }
 
 void
-csa_writeio(csa_res *resp, u_long offset, uint32_t data)
+csa_writeio(csa_res *resp, unsigned long offset, uint32_t data)
 {
 	if (offset < BA0_AC97_RESET)
 		bus_space_write_4(rman_get_bustag(resp->io), rman_get_bushandle(resp->io), offset, data);
@@ -1020,13 +1022,13 @@ csa_writeio(csa_res *resp, u_long offset, uint32_t data)
 }
 
 uint32_t
-csa_readmem(csa_res *resp, u_long offset)
+csa_readmem(csa_res *resp, unsigned long offset)
 {
 	return bus_space_read_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset);
 }
 
 void
-csa_writemem(csa_res *resp, u_long offset, uint32_t data)
+csa_writemem(csa_res *resp, unsigned long offset, uint32_t data)
 {
 	bus_space_write_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset, data);
 }
diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c
index f28bd0eea164..e176ac217a56 100644
--- a/sys/dev/sound/pci/csamidi.c
+++ b/sys/dev/sound/pci/csamidi.c
@@ -80,7 +80,7 @@ struct csa_midi_softc {
 static struct kobj_class csamidi_mpu_class;
 
 static uint32_t
-csamidi_readio(struct csa_midi_softc *scp, u_long offset)
+csamidi_readio(struct csa_midi_softc *scp, unsigned long offset)
 {
 	if (offset < BA0_AC97_RESET)
 		return bus_space_read_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset) & 0xffffffff;
@@ -89,7 +89,7 @@ csamidi_readio(struct csa_midi_softc *scp, u_long offset)
 }
 
 static void
-csamidi_writeio(struct csa_midi_softc *scp, u_long offset, uint32_t data)
+csamidi_writeio(struct csa_midi_softc *scp, unsigned long offset, uint32_t data)
 {
 	if (offset < BA0_AC97_RESET)
 		bus_space_write_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset, data);
diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c
index 318b37667a18..154c2f5a9cab 100644
--- a/sys/dev/sound/pci/csapcm.c
+++ b/sys/dev/sound/pci/csapcm.c
@@ -68,9 +68,9 @@ struct csa_info {
 
 	int active;
 	/* Contents of board's registers */
-	u_long		pfie;
-	u_long		pctl;
-	u_long		cctl;
+	unsigned long	pfie;
+	unsigned long	pctl;
+	unsigned long	cctl;
 	struct csa_chinfo pch, rch;
 	uint32_t	ac97[CS461x_AC97_NUMBER_RESTORE_REGS];
 	uint32_t	ac97_powerdown;
@@ -82,8 +82,9 @@ struct csa_info {
 /* prototypes */
 static int      csa_init(struct csa_info *);
 static void     csa_intr(void *);
-static void	csa_setplaysamplerate(csa_res *resp, u_long ulInRate);
-static void	csa_setcapturesamplerate(csa_res *resp, u_long ulOutRate);
+static void	csa_setplaysamplerate(csa_res *resp, unsigned long ulInRate);
+static void	csa_setcapturesamplerate(csa_res *resp,
+		    unsigned long ulOutRate);
 static void	csa_startplaydma(struct csa_info *csa);
 static void	csa_startcapturedma(struct csa_info *csa);
 static void	csa_stopplaydma(struct csa_info *csa);
@@ -170,12 +171,12 @@ static kobj_method_t csa_ac97_methods[] = {
 AC97_DECLARE(csa_ac97);
 
 static void
-csa_setplaysamplerate(csa_res *resp, u_long ulInRate)
+csa_setplaysamplerate(csa_res *resp, unsigned long ulInRate)
 {
-	u_long ulTemp1, ulTemp2;
-	u_long ulPhiIncr;
-	u_long ulCorrectionPerGOF, ulCorrectionPerSec;
-	u_long ulOutRate;
+	unsigned long ulTemp1, ulTemp2;
+	unsigned long ulPhiIncr;
+	unsigned long ulCorrectionPerGOF, ulCorrectionPerSec;
+	unsigned long ulOutRate;
 
 	ulOutRate = 48000;
 
@@ -216,12 +217,12 @@ csa_setplaysamplerate(csa_res *resp, u_long ulInRate)
 }
 
 static void
-csa_setcapturesamplerate(csa_res *resp, u_long ulOutRate)
+csa_setcapturesamplerate(csa_res *resp, unsigned long ulOutRate)
 {
-	u_long ulPhiIncr, ulCoeffIncr, ulTemp1, ulTemp2;
-	u_long ulCorrectionPerGOF, ulCorrectionPerSec, ulInitialDelay;
-	u_long dwFrameGroupLength, dwCnt;
-	u_long ulInRate;
+	unsigned long ulPhiIncr, ulCoeffIncr, ulTemp1, ulTemp2;
+	unsigned long ulCorrectionPerGOF, ulCorrectionPerSec, ulInitialDelay;
+	unsigned long dwFrameGroupLength, dwCnt;
+	unsigned long ulInRate;
 
 	ulInRate = 48000;
 
@@ -333,7 +334,7 @@ static void
 csa_startplaydma(struct csa_info *csa)
 {
 	csa_res *resp;
-	u_long ul;
+	unsigned long ul;
 
 	if (!csa->pch.dma) {
 		resp = &csa->res;
@@ -349,7 +350,7 @@ static void
 csa_startcapturedma(struct csa_info *csa)
 {
 	csa_res *resp;
-	u_long ul;
+	unsigned long ul;
 
 	if (!csa->rch.dma) {
 		resp = &csa->res;
@@ -365,7 +366,7 @@ static void
 csa_stopplaydma(struct csa_info *csa)
 {
 	csa_res *resp;
-	u_long ul;
+	unsigned long ul;
 
 	if (csa->pch.dma) {
 		resp = &csa->res;
@@ -392,7 +393,7 @@ static void
 csa_stopcapturedma(struct csa_info *csa)
 {
 	csa_res *resp;
-	u_long ul;
+	unsigned long ul;
 
 	if (csa->rch.dma) {
 		resp = &csa->res;
@@ -419,7 +420,7 @@ static int
 csa_startdsp(csa_res *resp)
 {
 	int i;
-	u_long ul;
+	unsigned long ul;
 
 	/*
 	 * Set the frame timer to reflect the number of cycles per frame.
@@ -479,7 +480,7 @@ csa_setupchan(struct csa_chinfo *ch)
 {
 	struct csa_info *csa = ch->parent;
 	csa_res *resp = &csa->res;
-	u_long pdtc, tmp;
+	unsigned long pdtc, tmp;
 
 	if (ch->dir == PCMDIR_PLAY) {
 		/* direction */
diff --git a/sys/dev/sound/pci/csavar.h b/sys/dev/sound/pci/csavar.h
index 5ff9e3e4cda1..fa9aa8d8f5a0 100644
--- a/sys/dev/sound/pci/csavar.h
+++ b/sys/dev/sound/pci/csavar.h
@@ -58,13 +58,13 @@ void csa_clearserialfifos(csa_res *resp);
 
 /* Common functions for csa. */
 struct csa_card *csa_findsubcard(device_t dev);
-int csa_readcodec(csa_res *resp, u_long offset, uint32_t *data);
-int csa_writecodec(csa_res *resp, u_long offset, uint32_t data);
+int csa_readcodec(csa_res *resp, unsigned long offset, uint32_t *data);
+int csa_writecodec(csa_res *resp, unsigned long offset, uint32_t data);
 
-uint32_t csa_readio(csa_res *resp, u_long offset);
-void csa_writeio(csa_res *resp, u_long offset, uint32_t data);
-uint32_t csa_readmem(csa_res *resp, u_long offset);
-void csa_writemem(csa_res *resp, u_long offset, uint32_t data);
+uint32_t csa_readio(csa_res *resp, unsigned long offset);
+void csa_writeio(csa_res *resp, unsigned long offset, uint32_t data);
+uint32_t csa_readmem(csa_res *resp, unsigned long offset);
+void csa_writemem(csa_res *resp, unsigned long offset, uint32_t data);
 
 void csa_resetdsp(csa_res *resp);
 #endif /* _CSA_VAR_H */
diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c
index 59b6f75ad6a0..08ba83a54d2a 100644
--- a/sys/dev/sound/pci/vibes.c
+++ b/sys/dev/sound/pci/vibes.c
@@ -724,7 +724,7 @@ sv_attach(device_t dev) {
 	rman_res_t	count, midi_start, games_start;
 	uint32_t	data;
 	char		status[SND_STATUSLEN];
-	u_long		sdmaa, sdmac, ml, mu;
+	unsigned long	sdmaa, sdmac, ml, mu;
 
 	sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
 	sc->dev = dev;
@@ -815,7 +815,8 @@ sv_attach(device_t dev) {
 	    ((mu - ml) % 0x200)) {
 		device_printf(dev, "sv_attach: resource assumptions not met "
 			      "(midi 0x%08lx, games 0x%08lx)\n",
-			      (u_long)midi_start, (u_long)games_start);
+			      (unsigned long)midi_start,
+			      (unsigned long)games_start);
 		goto fail;
 	}
 
diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c
index fe46dc069b05..ca8a6ea47b42 100644
--- a/sys/dev/sound/pcm/buffer.c
+++ b/sys/dev/sound/pcm/buffer.c
@@ -97,8 +97,9 @@ sndbuf_setmap(void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
 	if (snd_verbose > 3) {
 		printf("sndbuf_setmap %lx, %lx; ",
-		    (u_long)segs[0].ds_addr, (u_long)segs[0].ds_len);
-		printf("%p -> %lx\n", b->buf, (u_long)segs[0].ds_addr);
+		    (unsigned long)segs[0].ds_addr,
+		    (unsigned long)segs[0].ds_len);
+		printf("%p -> %lx\n", b->buf, (unsigned long)segs[0].ds_addr);
 	}
 	if (error == 0)
 		b->buf_addr = segs[0].ds_addr;
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 2f0091f67ac1..8952447a705a 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -536,7 +536,7 @@ dsp_write(struct cdev *i_dev, struct uio *buf, int flag)
 
 static int
 dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch,
-    u_long cmd, caddr_t arg)
+    unsigned long cmd, caddr_t arg)
 {
 	struct snddev_info *d;
 	struct pcm_channel *rdch, *wrch;
@@ -690,13 +690,13 @@ typedef struct audio_errinfo32
 #endif
 
 static int
-dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode,
+dsp_ioctl(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode,
     struct thread *td)
 {
 	struct dsp_cdevpriv *priv;
     	struct pcm_channel *chn, *rdch, *wrch;
 	struct snddev_info *d;
-	u_long xcmd;
+	unsigned long xcmd;
 	int *arg_i, ret, tmp, err;
 
 	if ((err = devfs_get_cdevpriv((void **)&priv)) != 0)
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 7d0fe8747d35..c3b57970efdc 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -956,7 +956,7 @@ mixer_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
 }
 
 static int
-mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode,
+mixer_ioctl(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode,
     struct thread *td)
 {
 	struct snddev_info *d;
@@ -994,7 +994,7 @@ mixer_mixerinfo(struct snd_mixer *m, mixer_info *mi)
  *     function, be it through Giant, PCM_*, etc !
  */
 int
-mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode,
+mixer_ioctl_cmd(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode,
     struct thread *td)
 {
 	struct snd_mixer *m;
diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h
index 835d09f9dfb5..5d6ae4d746af 100644
--- a/sys/dev/sound/pcm/mixer.h
+++ b/sys/dev/sound/pcm/mixer.h
@@ -62,7 +62,8 @@ int mixer_delete(struct snd_mixer *m);
 int mixer_init(device_t dev, kobj_class_t cls, void *devinfo);
 int mixer_uninit(device_t dev);
 int mixer_reinit(device_t dev);
-int mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td);
+int mixer_ioctl_cmd(struct cdev *i_dev, unsigned long cmd, caddr_t arg,
+    int mode, struct thread *td);
 int mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi);
 
 int mixer_hwvol_init(device_t dev);
diff --git a/sys/dev/sound/sndstat.c b/sys/dev/sound/sndstat.c
index 5ef6136f6f88..d57983fa7da2 100644
--- a/sys/dev/sound/sndstat.c
+++ b/sys/dev/sound/sndstat.c
@@ -1045,8 +1045,8 @@ sndstat_flush_user_devs(struct sndstat_file *pf)
 }
 
 static int
-sndstat_ioctl(
-    struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+sndstat_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
+    struct thread *td)
 {
 	int err;
 	struct sndstat_file *pf;
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 12823f6de6eb..cce8d0f3dac5 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -551,7 +551,8 @@ static void	umidi_stop_read(struct usb_fifo *);
 static void	umidi_start_write(struct usb_fifo *);
 static void	umidi_stop_write(struct usb_fifo *);
 static int	umidi_open(struct usb_fifo *, int);
-static int	umidi_ioctl(struct usb_fifo *, u_long cmd, void *, int);
+static int	umidi_ioctl(struct usb_fifo *, unsigned long cmd, void *,
+		    int);
 static void	umidi_close(struct usb_fifo *, int);
 static void	umidi_init(device_t dev);
 static int	umidi_attach(device_t dev);
@@ -6050,7 +6051,7 @@ umidi_close(struct usb_fifo *fifo, int fflags)
 }
 
 static int
-umidi_ioctl(struct usb_fifo *fifo, u_long cmd, void *data,
+umidi_ioctl(struct usb_fifo *fifo, unsigned long cmd, void *data,
     int fflags)
 {
 	return (ENODEV);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.