hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/sound/oss/dmasound/dmasound_core.c
....@@ -206,12 +206,10 @@
206206
207207 MODULE_LICENSE("GPL");
208208
209
-#ifdef MODULE
210209 static int sq_unit = -1;
211210 static int mixer_unit = -1;
212211 static int state_unit = -1;
213212 static int irq_installed;
214
-#endif /* MODULE */
215213
216214 /* control over who can modify resources shared between play/record */
217215 static fmode_t shared_resource_owner;
....@@ -384,15 +382,13 @@
384382 .owner = THIS_MODULE,
385383 .llseek = no_llseek,
386384 .unlocked_ioctl = mixer_unlocked_ioctl,
385
+ .compat_ioctl = compat_ptr_ioctl,
387386 .open = mixer_open,
388387 .release = mixer_release,
389388 };
390389
391390 static void mixer_init(void)
392391 {
393
-#ifndef MODULE
394
- int mixer_unit;
395
-#endif
396392 mixer_unit = register_sound_mixer(&mixer_fops, -1);
397393 if (mixer_unit < 0)
398394 return;
....@@ -1167,6 +1163,7 @@
11671163 .write = sq_write,
11681164 .poll = sq_poll,
11691165 .unlocked_ioctl = sq_unlocked_ioctl,
1166
+ .compat_ioctl = compat_ptr_ioctl,
11701167 .open = sq_open,
11711168 .release = sq_release,
11721169 };
....@@ -1174,9 +1171,6 @@
11741171 static int sq_init(void)
11751172 {
11761173 const struct file_operations *fops = &sq_fops;
1177
-#ifndef MODULE
1178
- int sq_unit;
1179
-#endif
11801174
11811175 sq_unit = register_sound_dsp(fops, -1);
11821176 if (sq_unit < 0) {
....@@ -1378,9 +1372,6 @@
13781372
13791373 static int state_init(void)
13801374 {
1381
-#ifndef MODULE
1382
- int state_unit;
1383
-#endif
13841375 state_unit = register_sound_special(&state_fops, SND_DEV_STATUS);
13851376 if (state_unit < 0)
13861377 return state_unit ;
....@@ -1398,10 +1389,9 @@
13981389 int dmasound_init(void)
13991390 {
14001391 int res ;
1401
-#ifdef MODULE
1392
+
14021393 if (irq_installed)
14031394 return -EBUSY;
1404
-#endif
14051395
14061396 /* Set up sound queue, /dev/audio and /dev/dsp. */
14071397
....@@ -1420,9 +1410,7 @@
14201410 printk(KERN_ERR "DMA sound driver: Interrupt initialization failed\n");
14211411 return -ENODEV;
14221412 }
1423
-#ifdef MODULE
14241413 irq_installed = 1;
1425
-#endif
14261414
14271415 printk(KERN_INFO "%s DMA sound driver rev %03d installed\n",
14281416 dmasound.mach.name, (DMASOUND_CORE_REVISION<<4) +
....@@ -1435,8 +1423,6 @@
14351423 numWriteBufs, writeBufSize) ;
14361424 return 0;
14371425 }
1438
-
1439
-#ifdef MODULE
14401426
14411427 void dmasound_deinit(void)
14421428 {
....@@ -1456,9 +1442,7 @@
14561442 unregister_sound_dsp(sq_unit);
14571443 }
14581444
1459
-#else /* !MODULE */
1460
-
1461
-static int dmasound_setup(char *str)
1445
+static int __maybe_unused dmasound_setup(char *str)
14621446 {
14631447 int ints[6], size;
14641448
....@@ -1476,13 +1460,13 @@
14761460 printk("dmasound_setup: invalid catch radius, using default = %d\n", catchRadius);
14771461 else
14781462 catchRadius = ints[3];
1479
- /* fall through */
1463
+ fallthrough;
14801464 case 2:
14811465 if (ints[1] < MIN_BUFFERS)
14821466 printk("dmasound_setup: invalid number of buffers, using default = %d\n", numWriteBufs);
14831467 else
14841468 numWriteBufs = ints[1];
1485
- /* fall through */
1469
+ fallthrough;
14861470 case 1:
14871471 if ((size = ints[2]) < 256) /* check for small buffer specs */
14881472 size <<= 10 ;
....@@ -1500,8 +1484,6 @@
15001484 }
15011485
15021486 __setup("dmasound=", dmasound_setup);
1503
-
1504
-#endif /* !MODULE */
15051487
15061488 /*
15071489 * Conversion tables
....@@ -1589,9 +1571,7 @@
15891571
15901572 EXPORT_SYMBOL(dmasound);
15911573 EXPORT_SYMBOL(dmasound_init);
1592
-#ifdef MODULE
15931574 EXPORT_SYMBOL(dmasound_deinit);
1594
-#endif
15951575 EXPORT_SYMBOL(dmasound_write_sq);
15961576 EXPORT_SYMBOL(dmasound_catchRadius);
15971577 #ifdef HAS_8BIT_TABLES