Skip to content

Commit a67ca25

Browse files
committed
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>
1 parent f246406 commit a67ca25

7 files changed

Lines changed: 0 additions & 68 deletions

File tree

‎sound/core/seq/oss/seq_oss.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ MODULE_LICENSE("GPL");
3939
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER);
4040
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC);
4141

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-
4842

4943
/*
5044
* prototypes
@@ -244,7 +238,6 @@ register_device(void)
244238
mutex_unlock(&register_mutex);
245239
return rc;
246240
}
247-
debug_printk(("device registered\n"));
248241
mutex_unlock(&register_mutex);
249242
return 0;
250243
}
@@ -253,7 +246,6 @@ static void
253246
unregister_device(void)
254247
{
255248
mutex_lock(&register_mutex);
256-
debug_printk(("device unregistered\n"));
257249
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0)
258250
snd_printk(KERN_ERR "error unregister device music\n");
259251
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0)

‎sound/core/seq/oss/seq_oss_device.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
#include <sound/seq_kernel.h>
3232
#include <sound/info.h>
3333

34-
/* enable debug print */
35-
#define SNDRV_SEQ_OSS_DEBUG
36-
3734
/* max. applications */
3835
#define SNDRV_SEQ_OSS_MAX_CLIENTS 16
3936
#define SNDRV_SEQ_OSS_MAX_SYNTH_DEVS 16
@@ -176,13 +173,4 @@ snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event *ev,
176173
/* misc. functions for proc interface */
177174
char *enabled_str(int bool);
178175

179-
180-
/* for debug */
181-
#ifdef SNDRV_SEQ_OSS_DEBUG
182-
extern int seq_oss_debug;
183-
#define debug_printk(x) do { if (seq_oss_debug > 0) snd_printd x; } while (0)
184-
#else
185-
#define debug_printk(x) /**/
186-
#endif
187-
188176
#endif /* __SEQ_OSS_DEVICE_H */

‎sound/core/seq/oss/seq_oss_init.c‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ snd_seq_oss_create_client(void)
9292
goto __error;
9393

9494
system_client = rc;
95-
debug_printk(("new client = %d\n", rc));
9695

9796
/* create annoucement receiver port */
9897
memset(port, 0, sizeof(*port));
@@ -193,7 +192,6 @@ snd_seq_oss_open(struct file *file, int level)
193192
snd_printk(KERN_ERR "can't malloc device info\n");
194193
return -ENOMEM;
195194
}
196-
debug_printk(("oss_open: dp = %p\n", dp));
197195

198196
dp->cseq = system_client;
199197
dp->port = -1;
@@ -222,15 +220,13 @@ snd_seq_oss_open(struct file *file, int level)
222220
}
223221

224222
/* create port */
225-
debug_printk(("create new port\n"));
226223
rc = create_port(dp);
227224
if (rc < 0) {
228225
snd_printk(KERN_ERR "can't create port\n");
229226
goto _error;
230227
}
231228

232229
/* allocate queue */
233-
debug_printk(("allocate queue\n"));
234230
rc = alloc_seq_queue(dp);
235231
if (rc < 0)
236232
goto _error;
@@ -247,7 +243,6 @@ snd_seq_oss_open(struct file *file, int level)
247243
dp->file_mode = translate_mode(file);
248244

249245
/* initialize read queue */
250-
debug_printk(("initialize read queue\n"));
251246
if (is_read_mode(dp->file_mode)) {
252247
dp->readq = snd_seq_oss_readq_new(dp, maxqlen);
253248
if (!dp->readq) {
@@ -257,7 +252,6 @@ snd_seq_oss_open(struct file *file, int level)
257252
}
258253

259254
/* initialize write queue */
260-
debug_printk(("initialize write queue\n"));
261255
if (is_write_mode(dp->file_mode)) {
262256
dp->writeq = snd_seq_oss_writeq_new(dp, maxqlen);
263257
if (!dp->writeq) {
@@ -267,14 +261,12 @@ snd_seq_oss_open(struct file *file, int level)
267261
}
268262

269263
/* initialize timer */
270-
debug_printk(("initialize timer\n"));
271264
dp->timer = snd_seq_oss_timer_new(dp);
272265
if (!dp->timer) {
273266
snd_printk(KERN_ERR "can't alloc timer\n");
274267
rc = -ENOMEM;
275268
goto _error;
276269
}
277-
debug_printk(("timer initialized\n"));
278270

279271
/* set private data pointer */
280272
file->private_data = dp;
@@ -288,7 +280,6 @@ snd_seq_oss_open(struct file *file, int level)
288280
client_table[dp->index] = dp;
289281
num_clients++;
290282

291-
debug_printk(("open done\n"));
292283
return 0;
293284

294285
_error:
@@ -347,7 +338,6 @@ create_port(struct seq_oss_devinfo *dp)
347338
return rc;
348339

349340
dp->port = port.addr.port;
350-
debug_printk(("new port = %d\n", port.addr.port));
351341

352342
return 0;
353343
}
@@ -363,7 +353,6 @@ delete_port(struct seq_oss_devinfo *dp)
363353
return 0;
364354
}
365355

366-
debug_printk(("delete_port %i\n", dp->port));
367356
return snd_seq_event_port_detach(dp->cseq, dp->port);
368357
}
369358

@@ -438,21 +427,16 @@ snd_seq_oss_release(struct seq_oss_devinfo *dp)
438427
client_table[dp->index] = NULL;
439428
num_clients--;
440429

441-
debug_printk(("resetting..\n"));
442430
snd_seq_oss_reset(dp);
443431

444-
debug_printk(("cleaning up..\n"));
445432
snd_seq_oss_synth_cleanup(dp);
446433
snd_seq_oss_midi_cleanup(dp);
447434

448435
/* clear slot */
449-
debug_printk(("releasing resource..\n"));
450436
queue = dp->queue;
451437
if (dp->port >= 0)
452438
delete_port(dp);
453439
delete_seq_queue(queue);
454-
455-
debug_printk(("release done\n"));
456440
}
457441

458442

@@ -466,7 +450,6 @@ snd_seq_oss_drain_write(struct seq_oss_devinfo *dp)
466450
return;
467451
if (is_write_mode(dp->file_mode) && !is_nonblock_mode(dp->file_mode) &&
468452
dp->writeq) {
469-
debug_printk(("syncing..\n"));
470453
while (snd_seq_oss_writeq_sync(dp->writeq))
471454
;
472455
}

‎sound/core/seq/oss/seq_oss_ioctl.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,10 @@ snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long ca
9090
return snd_seq_oss_timer_ioctl(dp->timer, cmd, arg);
9191

9292
case SNDCTL_SEQ_PANIC:
93-
debug_printk(("panic\n"));
9493
snd_seq_oss_reset(dp);
9594
return -EINVAL;
9695

9796
case SNDCTL_SEQ_SYNC:
98-
debug_printk(("sync\n"));
9997
if (! is_write_mode(dp->file_mode) || dp->writeq == NULL)
10098
return 0;
10199
while (snd_seq_oss_writeq_sync(dp->writeq))
@@ -105,75 +103,61 @@ snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long ca
105103
return 0;
106104

107105
case SNDCTL_SEQ_RESET:
108-
debug_printk(("reset\n"));
109106
snd_seq_oss_reset(dp);
110107
return 0;
111108

112109
case SNDCTL_SEQ_TESTMIDI:
113-
debug_printk(("test midi\n"));
114110
if (get_user(dev, p))
115111
return -EFAULT;
116112
return snd_seq_oss_midi_open(dp, dev, dp->file_mode);
117113

118114
case SNDCTL_SEQ_GETINCOUNT:
119-
debug_printk(("get in count\n"));
120115
if (dp->readq == NULL || ! is_read_mode(dp->file_mode))
121116
return 0;
122117
return put_user(dp->readq->qlen, p) ? -EFAULT : 0;
123118

124119
case SNDCTL_SEQ_GETOUTCOUNT:
125-
debug_printk(("get out count\n"));
126120
if (! is_write_mode(dp->file_mode) || dp->writeq == NULL)
127121
return 0;
128122
return put_user(snd_seq_oss_writeq_get_free_size(dp->writeq), p) ? -EFAULT : 0;
129123

130124
case SNDCTL_SEQ_GETTIME:
131-
debug_printk(("get time\n"));
132125
return put_user(snd_seq_oss_timer_cur_tick(dp->timer), p) ? -EFAULT : 0;
133126

134127
case SNDCTL_SEQ_RESETSAMPLES:
135-
debug_printk(("reset samples\n"));
136128
if (get_user(dev, p))
137129
return -EFAULT;
138130
return snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
139131

140132
case SNDCTL_SEQ_NRSYNTHS:
141-
debug_printk(("nr synths\n"));
142133
return put_user(dp->max_synthdev, p) ? -EFAULT : 0;
143134

144135
case SNDCTL_SEQ_NRMIDIS:
145-
debug_printk(("nr midis\n"));
146136
return put_user(dp->max_mididev, p) ? -EFAULT : 0;
147137

148138
case SNDCTL_SYNTH_MEMAVL:
149-
debug_printk(("mem avail\n"));
150139
if (get_user(dev, p))
151140
return -EFAULT;
152141
val = snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
153142
return put_user(val, p) ? -EFAULT : 0;
154143

155144
case SNDCTL_FM_4OP_ENABLE:
156-
debug_printk(("4op\n"));
157145
if (get_user(dev, p))
158146
return -EFAULT;
159147
snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
160148
return 0;
161149

162150
case SNDCTL_SYNTH_INFO:
163151
case SNDCTL_SYNTH_ID:
164-
debug_printk(("synth info\n"));
165152
return snd_seq_oss_synth_info_user(dp, arg);
166153

167154
case SNDCTL_SEQ_OUTOFBAND:
168-
debug_printk(("out of band\n"));
169155
return snd_seq_oss_oob_user(dp, arg);
170156

171157
case SNDCTL_MIDI_INFO:
172-
debug_printk(("midi info\n"));
173158
return snd_seq_oss_midi_info_user(dp, arg);
174159

175160
case SNDCTL_SEQ_THRESHOLD:
176-
debug_printk(("threshold\n"));
177161
if (! is_write_mode(dp->file_mode))
178162
return 0;
179163
if (get_user(val, p))
@@ -186,7 +170,6 @@ snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long ca
186170
return 0;
187171

188172
case SNDCTL_MIDI_PRETIME:
189-
debug_printk(("pretime\n"));
190173
if (dp->readq == NULL || !is_read_mode(dp->file_mode))
191174
return 0;
192175
if (get_user(val, p))
@@ -199,7 +182,6 @@ snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long ca
199182
return put_user(val, p) ? -EFAULT : 0;
200183

201184
default:
202-
debug_printk(("others\n"));
203185
if (! is_write_mode(dp->file_mode))
204186
return -EIO;
205187
return snd_seq_oss_synth_ioctl(dp, 0, cmd, carg);

‎sound/core/seq/oss/seq_oss_midi.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo)
153153
struct seq_oss_midi *mdev;
154154
unsigned long flags;
155155

156-
debug_printk(("check for MIDI client %d port %d\n", pinfo->addr.client, pinfo->addr.port));
157156
/* the port must include generic midi */
158157
if (! (pinfo->type & SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC))
159158
return 0;
@@ -406,7 +405,6 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev)
406405
return 0;
407406
}
408407

409-
debug_printk(("closing client %d port %d mode %d\n", mdev->client, mdev->port, mdev->opened));
410408
memset(&subs, 0, sizeof(subs));
411409
if (mdev->opened & PERM_WRITE) {
412410
subs.sender = dp->addr;
@@ -470,7 +468,6 @@ snd_seq_oss_midi_reset(struct seq_oss_devinfo *dp, int dev)
470468
struct snd_seq_event ev;
471469
int c;
472470

473-
debug_printk(("resetting client %d port %d\n", mdev->client, mdev->port));
474471
memset(&ev, 0, sizeof(ev));
475472
ev.dest.client = mdev->client;
476473
ev.dest.port = mdev->port;

‎sound/core/seq/oss/seq_oss_synth.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ snd_seq_oss_synth_register(struct snd_seq_device *dev)
138138
}
139139
rec->seq_device = i;
140140
synth_devs[i] = rec;
141-
debug_printk(("synth %s registered %d\n", rec->name, i));
142141
spin_unlock_irqrestore(&register_lock, flags);
143142
dev->driver_data = rec;
144143
#ifdef SNDRV_OSS_INFO_DEV_SYNTH
@@ -256,7 +255,6 @@ snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp)
256255
}
257256
reset_channels(info);
258257
}
259-
debug_printk(("synth %d assigned\n", i));
260258
info->opened++;
261259
rec->opened++;
262260
dp->synth_opened++;
@@ -326,7 +324,6 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp)
326324
if (rec == NULL)
327325
continue;
328326
if (rec->opened > 0) {
329-
debug_printk(("synth %d closed\n", i));
330327
rec->oper.close(&info->arg);
331328
module_put(rec->oper.owner);
332329
rec->opened = 0;

‎sound/core/seq/oss/seq_oss_timer.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ snd_seq_oss_timer_ioctl(struct seq_oss_timer *timer, unsigned int cmd, int __use
233233
int value;
234234

235235
if (cmd == SNDCTL_SEQ_CTRLRATE) {
236-
debug_printk(("ctrl rate\n"));
237236
/* if *arg == 0, just return the current rate */
238237
if (get_user(value, arg))
239238
return -EFAULT;
@@ -248,21 +247,16 @@ snd_seq_oss_timer_ioctl(struct seq_oss_timer *timer, unsigned int cmd, int __use
248247

249248
switch (cmd) {
250249
case SNDCTL_TMR_START:
251-
debug_printk(("timer start\n"));
252250
return snd_seq_oss_timer_start(timer);
253251
case SNDCTL_TMR_STOP:
254-
debug_printk(("timer stop\n"));
255252
return snd_seq_oss_timer_stop(timer);
256253
case SNDCTL_TMR_CONTINUE:
257-
debug_printk(("timer continue\n"));
258254
return snd_seq_oss_timer_continue(timer);
259255
case SNDCTL_TMR_TEMPO:
260-
debug_printk(("timer tempo\n"));
261256
if (get_user(value, arg))
262257
return -EFAULT;
263258
return snd_seq_oss_timer_tempo(timer, value);
264259
case SNDCTL_TMR_TIMEBASE:
265-
debug_printk(("timer timebase\n"));
266260
if (get_user(value, arg))
267261
return -EFAULT;
268262
if (value < MIN_OSS_TIMEBASE)
@@ -276,7 +270,6 @@ snd_seq_oss_timer_ioctl(struct seq_oss_timer *timer, unsigned int cmd, int __use
276270
case SNDCTL_TMR_METRONOME:
277271
case SNDCTL_TMR_SELECT:
278272
case SNDCTL_TMR_SOURCE:
279-
debug_printk(("timer XXX\n"));
280273
/* not supported */
281274
return 0;
282275
}

0 commit comments

Comments
 (0)