aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/trident/trident_main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-10-11 15:39:35 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-11 15:39:35 -0400
commit56c5d900dbb8e042bfad035d18433476931d8f93 (patch)
tree00b793965beeef10db03e0ff021d2d965c410759 /sound/pci/trident/trident_main.c
parent4dd95b63ae25c5cad6986829b5e8788e9faa0330 (diff)
parentead9d23d803ea3a73766c3cb27bf7563ac8d7266 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: sound/core/memalloc.c
Diffstat (limited to 'sound/pci/trident/trident_main.c')
-rw-r--r--sound/pci/trident/trident_main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index a69b4206c69e..c612b435ca2b 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -2931,7 +2931,8 @@ static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
2931{ 2931{
2932 struct snd_trident_pcm_mixer *tmix; 2932 struct snd_trident_pcm_mixer *tmix;
2933 2933
2934 snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL); 2934 if (snd_BUG_ON(!trident || !voice || !substream))
2935 return -EINVAL;
2935 tmix = &trident->pcm_mixer[substream->number]; 2936 tmix = &trident->pcm_mixer[substream->number];
2936 tmix->voice = voice; 2937 tmix->voice = voice;
2937 tmix->vol = T4D_DEFAULT_PCM_VOL; 2938 tmix->vol = T4D_DEFAULT_PCM_VOL;
@@ -2946,7 +2947,8 @@ static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_tr
2946{ 2947{
2947 struct snd_trident_pcm_mixer *tmix; 2948 struct snd_trident_pcm_mixer *tmix;
2948 2949
2949 snd_assert(trident != NULL && substream != NULL, return -EINVAL); 2950 if (snd_BUG_ON(!trident || !substream))
2951 return -EINVAL;
2950 tmix = &trident->pcm_mixer[substream->number]; 2952 tmix = &trident->pcm_mixer[substream->number];
2951 tmix->voice = NULL; 2953 tmix->voice = NULL;
2952 snd_trident_notify_pcm_change(trident, tmix, substream->number, 0); 2954 snd_trident_notify_pcm_change(trident, tmix, substream->number, 0);
@@ -3131,7 +3133,8 @@ static unsigned char snd_trident_gameport_read(struct gameport *gameport)
3131{ 3133{
3132 struct snd_trident *chip = gameport_get_port_data(gameport); 3134 struct snd_trident *chip = gameport_get_port_data(gameport);
3133 3135
3134 snd_assert(chip, return 0); 3136 if (snd_BUG_ON(!chip))
3137 return 0;
3135 return inb(TRID_REG(chip, GAMEPORT_LEGACY)); 3138 return inb(TRID_REG(chip, GAMEPORT_LEGACY));
3136} 3139}
3137 3140
@@ -3139,7 +3142,8 @@ static void snd_trident_gameport_trigger(struct gameport *gameport)
3139{ 3142{
3140 struct snd_trident *chip = gameport_get_port_data(gameport); 3143 struct snd_trident *chip = gameport_get_port_data(gameport);
3141 3144
3142 snd_assert(chip, return); 3145 if (snd_BUG_ON(!chip))
3146 return;
3143 outb(0xff, TRID_REG(chip, GAMEPORT_LEGACY)); 3147 outb(0xff, TRID_REG(chip, GAMEPORT_LEGACY));
3144} 3148}
3145 3149
@@ -3148,7 +3152,8 @@ static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes
3148 struct snd_trident *chip = gameport_get_port_data(gameport); 3152 struct snd_trident *chip = gameport_get_port_data(gameport);
3149 int i; 3153 int i;
3150 3154
3151 snd_assert(chip, return 0); 3155 if (snd_BUG_ON(!chip))
3156 return 0;
3152 3157
3153 *buttons = (~inb(TRID_REG(chip, GAMEPORT_LEGACY)) >> 4) & 0xf; 3158 *buttons = (~inb(TRID_REG(chip, GAMEPORT_LEGACY)) >> 4) & 0xf;
3154 3159
@@ -3164,7 +3169,8 @@ static int snd_trident_gameport_open(struct gameport *gameport, int mode)
3164{ 3169{
3165 struct snd_trident *chip = gameport_get_port_data(gameport); 3170 struct snd_trident *chip = gameport_get_port_data(gameport);
3166 3171
3167 snd_assert(chip, return 0); 3172 if (snd_BUG_ON(!chip))
3173 return 0;
3168 3174
3169 switch (mode) { 3175 switch (mode) {
3170 case GAMEPORT_MODE_COOKED: 3176 case GAMEPORT_MODE_COOKED:
@@ -3891,8 +3897,8 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor
3891{ 3897{
3892 unsigned int i, val, mask[2] = { 0, 0 }; 3898 unsigned int i, val, mask[2] = { 0, 0 };
3893 3899
3894 snd_assert(v_min <= 63, return); 3900 if (snd_BUG_ON(v_min > 63 || v_max > 63))
3895 snd_assert(v_max <= 63, return); 3901 return;
3896 for (i = v_min; i <= v_max; i++) 3902 for (i = v_min; i <= v_max; i++)
3897 mask[i >> 5] |= 1 << (i & 0x1f); 3903 mask[i >> 5] |= 1 << (i & 0x1f);
3898 if (mask[0]) { 3904 if (mask[0]) {