Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: seq_oss: Drop debug prints

The debug prints in snd-seq-oss module are rather useless.
Let's clean up before further modifications.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

-68
-8
sound/core/seq/oss/seq_oss.c
··· 39 39 MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER); 40 40 MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC); 41 41 42 - #ifdef SNDRV_SEQ_OSS_DEBUG 43 - module_param(seq_oss_debug, int, 0644); 44 - MODULE_PARM_DESC(seq_oss_debug, "debug option"); 45 - int seq_oss_debug = 0; 46 - #endif 47 - 48 42 49 43 /* 50 44 * prototypes ··· 238 244 mutex_unlock(&register_mutex); 239 245 return rc; 240 246 } 241 - debug_printk(("device registered\n")); 242 247 mutex_unlock(&register_mutex); 243 248 return 0; 244 249 } ··· 246 253 unregister_device(void) 247 254 { 248 255 mutex_lock(&register_mutex); 249 - debug_printk(("device unregistered\n")); 250 256 if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0) 251 257 snd_printk(KERN_ERR "error unregister device music\n"); 252 258 if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0)
-12
sound/core/seq/oss/seq_oss_device.h
··· 31 31 #include <sound/seq_kernel.h> 32 32 #include <sound/info.h> 33 33 34 - /* enable debug print */ 35 - #define SNDRV_SEQ_OSS_DEBUG 36 - 37 34 /* max. applications */ 38 35 #define SNDRV_SEQ_OSS_MAX_CLIENTS 16 39 36 #define SNDRV_SEQ_OSS_MAX_SYNTH_DEVS 16 ··· 172 175 173 176 /* misc. functions for proc interface */ 174 177 char *enabled_str(int bool); 175 - 176 - 177 - /* for debug */ 178 - #ifdef SNDRV_SEQ_OSS_DEBUG 179 - extern int seq_oss_debug; 180 - #define debug_printk(x) do { if (seq_oss_debug > 0) snd_printd x; } while (0) 181 - #else 182 - #define debug_printk(x) /**/ 183 - #endif 184 178 185 179 #endif /* __SEQ_OSS_DEVICE_H */
-17
sound/core/seq/oss/seq_oss_init.c
··· 92 92 goto __error; 93 93 94 94 system_client = rc; 95 - debug_printk(("new client = %d\n", rc)); 96 95 97 96 /* create annoucement receiver port */ 98 97 memset(port, 0, sizeof(*port)); ··· 192 193 snd_printk(KERN_ERR "can't malloc device info\n"); 193 194 return -ENOMEM; 194 195 } 195 - debug_printk(("oss_open: dp = %p\n", dp)); 196 196 197 197 dp->cseq = system_client; 198 198 dp->port = -1; ··· 220 222 } 221 223 222 224 /* create port */ 223 - debug_printk(("create new port\n")); 224 225 rc = create_port(dp); 225 226 if (rc < 0) { 226 227 snd_printk(KERN_ERR "can't create port\n"); ··· 227 230 } 228 231 229 232 /* allocate queue */ 230 - debug_printk(("allocate queue\n")); 231 233 rc = alloc_seq_queue(dp); 232 234 if (rc < 0) 233 235 goto _error; ··· 243 247 dp->file_mode = translate_mode(file); 244 248 245 249 /* initialize read queue */ 246 - debug_printk(("initialize read queue\n")); 247 250 if (is_read_mode(dp->file_mode)) { 248 251 dp->readq = snd_seq_oss_readq_new(dp, maxqlen); 249 252 if (!dp->readq) { ··· 252 257 } 253 258 254 259 /* initialize write queue */ 255 - debug_printk(("initialize write queue\n")); 256 260 if (is_write_mode(dp->file_mode)) { 257 261 dp->writeq = snd_seq_oss_writeq_new(dp, maxqlen); 258 262 if (!dp->writeq) { ··· 261 267 } 262 268 263 269 /* initialize timer */ 264 - debug_printk(("initialize timer\n")); 265 270 dp->timer = snd_seq_oss_timer_new(dp); 266 271 if (!dp->timer) { 267 272 snd_printk(KERN_ERR "can't alloc timer\n"); 268 273 rc = -ENOMEM; 269 274 goto _error; 270 275 } 271 - debug_printk(("timer initialized\n")); 272 276 273 277 /* set private data pointer */ 274 278 file->private_data = dp; ··· 280 288 client_table[dp->index] = dp; 281 289 num_clients++; 282 290 283 - debug_printk(("open done\n")); 284 291 return 0; 285 292 286 293 _error: ··· 338 347 return rc; 339 348 340 349 dp->port = port.addr.port; 341 - debug_printk(("new port = %d\n", port.addr.port)); 342 350 343 351 return 0; 344 352 } ··· 353 363 return 0; 354 364 } 355 365 356 - debug_printk(("delete_port %i\n", dp->port)); 357 366 return snd_seq_event_port_detach(dp->cseq, dp->port); 358 367 } 359 368 ··· 427 438 client_table[dp->index] = NULL; 428 439 num_clients--; 429 440 430 - debug_printk(("resetting..\n")); 431 441 snd_seq_oss_reset(dp); 432 442 433 - debug_printk(("cleaning up..\n")); 434 443 snd_seq_oss_synth_cleanup(dp); 435 444 snd_seq_oss_midi_cleanup(dp); 436 445 437 446 /* clear slot */ 438 - debug_printk(("releasing resource..\n")); 439 447 queue = dp->queue; 440 448 if (dp->port >= 0) 441 449 delete_port(dp); 442 450 delete_seq_queue(queue); 443 - 444 - debug_printk(("release done\n")); 445 451 } 446 452 447 453 ··· 450 466 return; 451 467 if (is_write_mode(dp->file_mode) && !is_nonblock_mode(dp->file_mode) && 452 468 dp->writeq) { 453 - debug_printk(("syncing..\n")); 454 469 while (snd_seq_oss_writeq_sync(dp->writeq)) 455 470 ; 456 471 }
-18
sound/core/seq/oss/seq_oss_ioctl.c
··· 90 90 return snd_seq_oss_timer_ioctl(dp->timer, cmd, arg); 91 91 92 92 case SNDCTL_SEQ_PANIC: 93 - debug_printk(("panic\n")); 94 93 snd_seq_oss_reset(dp); 95 94 return -EINVAL; 96 95 97 96 case SNDCTL_SEQ_SYNC: 98 - debug_printk(("sync\n")); 99 97 if (! is_write_mode(dp->file_mode) || dp->writeq == NULL) 100 98 return 0; 101 99 while (snd_seq_oss_writeq_sync(dp->writeq)) ··· 103 105 return 0; 104 106 105 107 case SNDCTL_SEQ_RESET: 106 - debug_printk(("reset\n")); 107 108 snd_seq_oss_reset(dp); 108 109 return 0; 109 110 110 111 case SNDCTL_SEQ_TESTMIDI: 111 - debug_printk(("test midi\n")); 112 112 if (get_user(dev, p)) 113 113 return -EFAULT; 114 114 return snd_seq_oss_midi_open(dp, dev, dp->file_mode); 115 115 116 116 case SNDCTL_SEQ_GETINCOUNT: 117 - debug_printk(("get in count\n")); 118 117 if (dp->readq == NULL || ! is_read_mode(dp->file_mode)) 119 118 return 0; 120 119 return put_user(dp->readq->qlen, p) ? -EFAULT : 0; 121 120 122 121 case SNDCTL_SEQ_GETOUTCOUNT: 123 - debug_printk(("get out count\n")); 124 122 if (! is_write_mode(dp->file_mode) || dp->writeq == NULL) 125 123 return 0; 126 124 return put_user(snd_seq_oss_writeq_get_free_size(dp->writeq), p) ? -EFAULT : 0; 127 125 128 126 case SNDCTL_SEQ_GETTIME: 129 - debug_printk(("get time\n")); 130 127 return put_user(snd_seq_oss_timer_cur_tick(dp->timer), p) ? -EFAULT : 0; 131 128 132 129 case SNDCTL_SEQ_RESETSAMPLES: 133 - debug_printk(("reset samples\n")); 134 130 if (get_user(dev, p)) 135 131 return -EFAULT; 136 132 return snd_seq_oss_synth_ioctl(dp, dev, cmd, carg); 137 133 138 134 case SNDCTL_SEQ_NRSYNTHS: 139 - debug_printk(("nr synths\n")); 140 135 return put_user(dp->max_synthdev, p) ? -EFAULT : 0; 141 136 142 137 case SNDCTL_SEQ_NRMIDIS: 143 - debug_printk(("nr midis\n")); 144 138 return put_user(dp->max_mididev, p) ? -EFAULT : 0; 145 139 146 140 case SNDCTL_SYNTH_MEMAVL: 147 - debug_printk(("mem avail\n")); 148 141 if (get_user(dev, p)) 149 142 return -EFAULT; 150 143 val = snd_seq_oss_synth_ioctl(dp, dev, cmd, carg); 151 144 return put_user(val, p) ? -EFAULT : 0; 152 145 153 146 case SNDCTL_FM_4OP_ENABLE: 154 - debug_printk(("4op\n")); 155 147 if (get_user(dev, p)) 156 148 return -EFAULT; 157 149 snd_seq_oss_synth_ioctl(dp, dev, cmd, carg); ··· 149 161 150 162 case SNDCTL_SYNTH_INFO: 151 163 case SNDCTL_SYNTH_ID: 152 - debug_printk(("synth info\n")); 153 164 return snd_seq_oss_synth_info_user(dp, arg); 154 165 155 166 case SNDCTL_SEQ_OUTOFBAND: 156 - debug_printk(("out of band\n")); 157 167 return snd_seq_oss_oob_user(dp, arg); 158 168 159 169 case SNDCTL_MIDI_INFO: 160 - debug_printk(("midi info\n")); 161 170 return snd_seq_oss_midi_info_user(dp, arg); 162 171 163 172 case SNDCTL_SEQ_THRESHOLD: 164 - debug_printk(("threshold\n")); 165 173 if (! is_write_mode(dp->file_mode)) 166 174 return 0; 167 175 if (get_user(val, p)) ··· 170 186 return 0; 171 187 172 188 case SNDCTL_MIDI_PRETIME: 173 - debug_printk(("pretime\n")); 174 189 if (dp->readq == NULL || !is_read_mode(dp->file_mode)) 175 190 return 0; 176 191 if (get_user(val, p)) ··· 182 199 return put_user(val, p) ? -EFAULT : 0; 183 200 184 201 default: 185 - debug_printk(("others\n")); 186 202 if (! is_write_mode(dp->file_mode)) 187 203 return -EIO; 188 204 return snd_seq_oss_synth_ioctl(dp, 0, cmd, carg);
-3
sound/core/seq/oss/seq_oss_midi.c
··· 153 153 struct seq_oss_midi *mdev; 154 154 unsigned long flags; 155 155 156 - debug_printk(("check for MIDI client %d port %d\n", pinfo->addr.client, pinfo->addr.port)); 157 156 /* the port must include generic midi */ 158 157 if (! (pinfo->type & SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC)) 159 158 return 0; ··· 405 406 return 0; 406 407 } 407 408 408 - debug_printk(("closing client %d port %d mode %d\n", mdev->client, mdev->port, mdev->opened)); 409 409 memset(&subs, 0, sizeof(subs)); 410 410 if (mdev->opened & PERM_WRITE) { 411 411 subs.sender = dp->addr; ··· 468 470 struct snd_seq_event ev; 469 471 int c; 470 472 471 - debug_printk(("resetting client %d port %d\n", mdev->client, mdev->port)); 472 473 memset(&ev, 0, sizeof(ev)); 473 474 ev.dest.client = mdev->client; 474 475 ev.dest.port = mdev->port;
-3
sound/core/seq/oss/seq_oss_synth.c
··· 138 138 } 139 139 rec->seq_device = i; 140 140 synth_devs[i] = rec; 141 - debug_printk(("synth %s registered %d\n", rec->name, i)); 142 141 spin_unlock_irqrestore(&register_lock, flags); 143 142 dev->driver_data = rec; 144 143 #ifdef SNDRV_OSS_INFO_DEV_SYNTH ··· 255 256 } 256 257 reset_channels(info); 257 258 } 258 - debug_printk(("synth %d assigned\n", i)); 259 259 info->opened++; 260 260 rec->opened++; 261 261 dp->synth_opened++; ··· 324 326 if (rec == NULL) 325 327 continue; 326 328 if (rec->opened > 0) { 327 - debug_printk(("synth %d closed\n", i)); 328 329 rec->oper.close(&info->arg); 329 330 module_put(rec->oper.owner); 330 331 rec->opened = 0;
-7
sound/core/seq/oss/seq_oss_timer.c
··· 233 233 int value; 234 234 235 235 if (cmd == SNDCTL_SEQ_CTRLRATE) { 236 - debug_printk(("ctrl rate\n")); 237 236 /* if *arg == 0, just return the current rate */ 238 237 if (get_user(value, arg)) 239 238 return -EFAULT; ··· 247 248 248 249 switch (cmd) { 249 250 case SNDCTL_TMR_START: 250 - debug_printk(("timer start\n")); 251 251 return snd_seq_oss_timer_start(timer); 252 252 case SNDCTL_TMR_STOP: 253 - debug_printk(("timer stop\n")); 254 253 return snd_seq_oss_timer_stop(timer); 255 254 case SNDCTL_TMR_CONTINUE: 256 - debug_printk(("timer continue\n")); 257 255 return snd_seq_oss_timer_continue(timer); 258 256 case SNDCTL_TMR_TEMPO: 259 - debug_printk(("timer tempo\n")); 260 257 if (get_user(value, arg)) 261 258 return -EFAULT; 262 259 return snd_seq_oss_timer_tempo(timer, value); 263 260 case SNDCTL_TMR_TIMEBASE: 264 - debug_printk(("timer timebase\n")); 265 261 if (get_user(value, arg)) 266 262 return -EFAULT; 267 263 if (value < MIN_OSS_TIMEBASE) ··· 270 276 case SNDCTL_TMR_METRONOME: 271 277 case SNDCTL_TMR_SELECT: 272 278 case SNDCTL_TMR_SOURCE: 273 - debug_printk(("timer XXX\n")); 274 279 /* not supported */ 275 280 return 0; 276 281 }