FreeBSD Bugzilla – Attachment 148546 Details for
Bug 194517
[patch] sound: Remove obsolete __FreeBSD_version checks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sound: Remove obsolete __FreeBSD_version checks
0001-sound-Remove-obsolete-__FreeBSD_version-checks.patch (text/plain), 12.63 KB, created by
ftigeot
on 2014-10-21 20:28:30 UTC
(
hide
)
Description:
sound: Remove obsolete __FreeBSD_version checks
Filename:
MIME Type:
Creator:
ftigeot
Created:
2014-10-21 20:28:30 UTC
Size:
12.63 KB
patch
obsolete
>From 4b4a582879bb7b4d56d941fb110b5bba474e8109 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fran=C3=A7ois=20Tigeot?= <ftigeot@wolfpond.org> >Date: Tue, 21 Oct 2014 22:24:35 +0100 >Subject: [PATCH] sound: Remove obsolete __FreeBSD_version checks > >--- > sys/dev/sound/isa/gusc.c | 6 ------ > sys/dev/sound/isa/sb16.c | 2 -- > sys/dev/sound/isa/sbc.c | 6 ------ > sys/dev/sound/midi/sequencer.c | 9 --------- > sys/dev/sound/pci/als4000.c | 10 ---------- > sys/dev/sound/pci/cs4281.c | 12 ------------ > sys/dev/sound/pci/csa.c | 6 ------ > sys/dev/sound/pci/emu10kx.c | 2 -- > sys/dev/sound/pci/envy24.c | 4 ---- > sys/dev/sound/pci/envy24ht.c | 4 ---- > sys/dev/sound/pci/maestro.c | 10 ---------- > sys/dev/sound/pci/vibes.c | 2 -- > sys/dev/sound/pcm/dsp.c | 2 -- > sys/dev/sound/pcm/mixer.c | 2 -- > sys/dev/sound/pcm/sound.c | 6 +----- > sys/dev/sound/pcm/sound.h | 7 ------- > 16 files changed, 1 insertion(+), 89 deletions(-) > >diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c >index 58ac346..a45e7e6 100644 >--- a/sys/dev/sound/isa/gusc.c >+++ b/sys/dev/sound/isa/gusc.c >@@ -421,20 +421,16 @@ gusc_release_resource(device_t bus, device_t child, int type, int rid, > > static int > gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, >-#if __FreeBSD_version >= 700031 > driver_filter_t *filter, >-#endif > driver_intr_t *intr, void *arg, void **cookiep) > { > sc_p scp = (sc_p)device_get_softc(dev); > devclass_t devclass; > >-#if __FreeBSD_version >= 700031 > if (filter != NULL) { > printf("gusc.c: we cannot use a filter here\n"); > return (EINVAL); > } >-#endif > devclass = device_get_devclass(child); > if (strcmp(devclass_get_name(devclass), "midi") == 0) { > scp->midi_intr.intr = intr; >@@ -446,9 +442,7 @@ gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, > return 0; > } > return bus_generic_setup_intr(dev, child, irq, flags, >-#if __FreeBSD_version >= 700031 > filter, >-#endif > intr, arg, cookiep); > } > >diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c >index 3e3cbc8..536de77 100644 >--- a/sys/dev/sound/isa/sb16.c >+++ b/sys/dev/sound/isa/sb16.c >@@ -176,10 +176,8 @@ sb_dspwr(struct sb_info *sb, u_char val) > return 1; > } > } >-#if __FreeBSD_version > 500000 > if (curthread->td_intr_nesting_level == 0) > printf("sb_dspwr(0x%02x) timed out.\n", val); >-#endif > return 0; > } > >diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c >index aa6003b..6f8f64e 100644 >--- a/sys/dev/sound/isa/sbc.c >+++ b/sys/dev/sound/isa/sbc.c >@@ -85,9 +85,7 @@ static int sbc_release_resource(device_t bus, device_t child, int type, int rid, > struct resource *r); > static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq, > int flags, >-#if __FreeBSD_version >= 700031 > driver_filter_t *filter, >-#endif > driver_intr_t *intr, > void *arg, void **cookiep); > static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq, >@@ -512,9 +510,7 @@ sbc_intr(void *p) > > static int > sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, >-#if __FreeBSD_version >= 700031 > driver_filter_t *filter, >-#endif > driver_intr_t *intr, > void *arg, void **cookiep) > { >@@ -522,12 +518,10 @@ sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, > struct sbc_ihl *ihl = NULL; > int i, ret; > >-#if __FreeBSD_version >= 700031 > if (filter != NULL) { > printf("sbc.c: we cannot use a filter here\n"); > return (EINVAL); > } >-#endif > sbc_lock(scp); > i = 0; > while (i < IRQ_MAX) { >diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c >index 1ef7845..008d6bd 100644 >--- a/sys/dev/sound/midi/sequencer.c >+++ b/sys/dev/sound/midi/sequencer.c >@@ -466,12 +466,7 @@ done: > cv_broadcast(&scp->th_cv); > mtx_unlock(&scp->seq_lock); > SEQ_DEBUG(2, printf("seq_eventthread finished\n")); >-#if __FreeBSD_version >= 800002 > kproc_exit(0); >-#else >- mtx_lock(&Giant); >- kthread_exit(0); >-#endif > } > > /* >@@ -587,11 +582,7 @@ seq_addunit(void) > */ > > ret = >-#if __FreeBSD_version >= 800002 > kproc_create >-#else >- kthread_create >-#endif > (seq_eventthread, scp, NULL, RFHIGHPID, 0, > "sequencer %02d", scp->unit); > >diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c >index 0cd51e3..2765660 100644 >--- a/sys/dev/sound/pci/als4000.c >+++ b/sys/dev/sound/pci/als4000.c >@@ -818,22 +818,12 @@ als_pci_attach(device_t dev) > * ALS4000 is entirely controlled by the pci powerstate. We > * could attempt finer grained control by setting GCR6.31. > */ >-#if __FreeBSD_version > 500000 > if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { > /* Reset the power state. */ > device_printf(dev, "chip is in D%d power mode " > "-- setting to D0\n", pci_get_powerstate(dev)); > pci_set_powerstate(dev, PCI_POWERSTATE_D0); > } >-#else >- data = pci_read_config(dev, ALS_PCI_POWERREG, 2); >- if ((data & 0x03) != 0) { >- device_printf(dev, "chip is in D%d power mode " >- "-- setting to D0\n", data & 0x03); >- data &= ~0x03; >- pci_write_config(dev, ALS_PCI_POWERREG, data, 2); >- } >-#endif > > if (als_resource_grab(dev, sc)) { > device_printf(dev, "failed to allocate resources\n"); >diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c >index 6e1b17d..7ad6502 100644 >--- a/sys/dev/sound/pci/cs4281.c >+++ b/sys/dev/sound/pci/cs4281.c >@@ -768,7 +768,6 @@ cs4281_pci_attach(device_t dev) > > pci_enable_busmaster(dev); > >-#if __FreeBSD_version > 500000 > if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { > /* Reset the power state. */ > device_printf(dev, "chip is in D%d power mode " >@@ -776,17 +775,6 @@ cs4281_pci_attach(device_t dev) > > pci_set_powerstate(dev, PCI_POWERSTATE_D0); > } >-#else >- data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4); >- if (data & CS4281PCI_PMCS_PS_MASK) { >- /* Reset the power state. */ >- device_printf(dev, "chip is in D%d power mode " >- "-- setting to D0\n", >- data & CS4281PCI_PMCS_PS_MASK); >- pci_write_config(dev, CS4281PCI_PMCS_OFFSET, >- data & ~CS4281PCI_PMCS_PS_MASK, 4); >- } >-#endif > > sc->regid = PCIR_BAR(0); > sc->regtype = SYS_RES_MEMORY; >diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c >index 4a766e7..e406410 100644 >--- a/sys/dev/sound/pci/csa.c >+++ b/sys/dev/sound/pci/csa.c >@@ -86,9 +86,7 @@ static int csa_release_resource(device_t bus, device_t child, int type, int rid, > struct resource *r); > static int csa_setup_intr(device_t bus, device_t child, > struct resource *irq, int flags, >-#if __FreeBSD_version >= 700031 > driver_filter_t *filter, >-#endif > driver_intr_t *intr, void *arg, void **cookiep); > static int csa_teardown_intr(device_t bus, device_t child, > struct resource *irq, void *cookie); >@@ -450,21 +448,17 @@ csa_release_resource(device_t bus, device_t child, int type, int rid, > static int > csa_setup_intr(device_t bus, device_t child, > struct resource *irq, int flags, >-#if __FreeBSD_version >= 700031 > driver_filter_t *filter, >-#endif > driver_intr_t *intr, void *arg, void **cookiep) > { > sc_p scp; > csa_res *resp; > struct sndcard_func *func; > >-#if __FreeBSD_version >= 700031 > if (filter != NULL) { > printf("ata-csa.c: we cannot use a filter here\n"); > return (EINVAL); > } >-#endif > scp = device_get_softc(bus); > resp = &scp->res; > >diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c >index 5309dfb..051a874 100644 >--- a/sys/dev/sound/pci/emu10kx.c >+++ b/sys/dev/sound/pci/emu10kx.c >@@ -3203,9 +3203,7 @@ emu_pci_attach(device_t dev) > i = 0; > sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); > if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, >-#if __FreeBSD_version >= 700031 > NULL, >-#endif > emu_intr, sc, &sc->ih)) { > device_printf(dev, "unable to map interrupt\n"); > goto bad; >diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c >index 5b39ff8..ce03998 100644 >--- a/sys/dev/sound/pci/envy24.c >+++ b/sys/dev/sound/pci/envy24.c >@@ -2690,11 +2690,7 @@ static device_method_t envy24_methods[] = { > static driver_t envy24_driver = { > "pcm", > envy24_methods, >-#if __FreeBSD_version > 500000 > PCM_SOFTC_SIZE, >-#else >- sizeof(struct snddev_info), >-#endif > }; > > DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0); >diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c >index 0619ac1..7e96be6 100644 >--- a/sys/dev/sound/pci/envy24ht.c >+++ b/sys/dev/sound/pci/envy24ht.c >@@ -2588,11 +2588,7 @@ static device_method_t envy24ht_methods[] = { > static driver_t envy24ht_driver = { > "pcm", > envy24ht_methods, >-#if __FreeBSD_version > 500000 > PCM_SOFTC_SIZE, >-#else >- sizeof(struct snddev_info), >-#endif > }; > > DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0); >diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c >index c95aa6c..c7cbb35 100644 >--- a/sys/dev/sound/pci/maestro.c >+++ b/sys/dev/sound/pci/maestro.c >@@ -87,12 +87,6 @@ SND_DECLARE_FILE("$FreeBSD$"); > #define AGG_DEFAULT_BUFSZ 0x4000 /* 0x1000, but gets underflows */ > > >-/* compatibility */ >-#if __FreeBSD_version < 500000 >-# define critical_enter() disable_intr() >-# define critical_exit() enable_intr() >-#endif >- > #ifndef PCIR_BAR > #define PCIR_BAR(x) (PCIR_MAPS + (x) * 4) > #endif >@@ -1815,9 +1809,7 @@ agg_attach(device_t dev) > /*filter*/ NULL, NULL, > /*size */ ess->bufsz, 1, 0x3ffff, > /*flags */ 0, >-#if __FreeBSD_version >= 501102 > /*lock */ busdma_lock_mutex, &Giant, >-#endif > &ess->buf_dmat) != 0) { > device_printf(dev, "unable to create dma tag\n"); > ret = ENOMEM; >@@ -1831,9 +1823,7 @@ agg_attach(device_t dev) > /*filter*/ NULL, NULL, > /*size */ 3*ess->bufsz, 1, 0x3ffff, > /*flags */ 0, >-#if __FreeBSD_version >= 501102 > /*lock */ busdma_lock_mutex, &Giant, >-#endif > &ess->stat_dmat) != 0) { > device_printf(dev, "unable to create dma tag\n"); > ret = ENOMEM; >diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c >index 733e0d8..f0cb57f 100644 >--- a/sys/dev/sound/pci/vibes.c >+++ b/sys/dev/sound/pci/vibes.c >@@ -730,13 +730,11 @@ sv_attach(device_t dev) { > > pci_enable_busmaster(dev); > >-#if __FreeBSD_version > 500000 > if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { > device_printf(dev, "chip is in D%d power mode " > "-- setting to D0\n", pci_get_powerstate(dev)); > pci_set_powerstate(dev, PCI_POWERSTATE_D0); > } >-#endif > sc->enh_rid = SV_PCI_ENHANCED; > sc->enh_type = SYS_RES_IOPORT; > sc->enh_reg = bus_alloc_resource(dev, sc->enh_type, >diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c >index 5195da2..54ad75e 100644 >--- a/sys/dev/sound/pcm/dsp.c >+++ b/sys/dev/sound/pcm/dsp.c >@@ -2324,9 +2324,7 @@ dsp_stdclone(char *name, char *namep, char *sep, int use_sep, int *u, int *c) > > static void > dsp_clone(void *arg, >-#if __FreeBSD_version >= 600034 > struct ucred *cred, >-#endif > char *name, int namelen, struct cdev **dev) > { > struct snddev_info *d; >diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c >index 1c53076..c0c8013 100644 >--- a/sys/dev/sound/pcm/mixer.c >+++ b/sys/dev/sound/pcm/mixer.c >@@ -1328,9 +1328,7 @@ done: > > static void > mixer_clone(void *arg, >-#if __FreeBSD_version >= 600034 > struct ucred *cred, >-#endif > char *name, int namelen, struct cdev **dev) > { > struct snddev_info *d; >diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c >index 8b43879..72b2bda 100644 >--- a/sys/dev/sound/pcm/sound.c >+++ b/sys/dev/sound/pcm/sound.c >@@ -124,11 +124,7 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand > if (d != NULL && (flags & INTR_MPSAFE)) > d->flags |= SD_F_MPSAFE; > >- return bus_setup_intr(dev, res, flags, >-#if __FreeBSD_version >= 700031 >- NULL, >-#endif >- hand, param, cookiep); >+ return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); > } > > static void >diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h >index 80cc645..3565ca5 100644 >--- a/sys/dev/sound/pcm/sound.h >+++ b/sys/dev/sound/pcm/sound.h >@@ -53,9 +53,6 @@ > #include <sys/errno.h> > #include <sys/malloc.h> > #include <sys/bus.h> >-#if __FreeBSD_version < 500000 >-#include <sys/buf.h> >-#endif > #include <machine/resource.h> > #include <machine/bus.h> > #include <sys/rman.h> >@@ -120,11 +117,7 @@ struct snd_mixer; > #define PCMCHAN(x) (snd_unit2c(dev2unit(x))) > > /* XXX unit2minor compat */ >-#if __FreeBSD_version >= 800062 > #define PCMMINOR(x) (x) >-#else >-#define PCMMINOR(x) unit2minor(x) >-#endif > > /* > * By design, limit possible channels for each direction. >-- >2.0.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 194517
:
148545
| 148546