Commit 68a9edd18c62953db476142c06cb65326aeb0b31

Authored by Himangi Saraogi
Committed by Takashi Iwai
1 parent 80e7bbac48

sound: oss: Remove typedefs wanc_info and wavnc_port_info

The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedefs for wanc_info and
wavnc_port_info.

A simplified version of the Coccinelle semantic patch that finds the case is:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 89 additions and 68 deletions Side-by-side Diff

sound/oss/waveartist.c
... ... @@ -92,7 +92,7 @@
92 92 0x0000 /* Monitor */
93 93 };
94 94  
95   -typedef struct {
  95 +struct wavnc_info {
96 96 struct address_info hw; /* hardware */
97 97 char *chip_name;
98 98  
... ... @@ -119,7 +119,7 @@
119 119 unsigned int line_mute_state :1;/* set by ioctl or autoselect */
120 120 unsigned int use_slider :1;/* use slider setting for o/p vol */
121 121 #endif
122   -} wavnc_info;
  122 +};
123 123  
124 124 /*
125 125 * This is the implementation specific mixer information.
126 126  
127 127  
128 128  
129 129  
130 130  
131 131  
... ... @@ -129,29 +129,30 @@
129 129 unsigned int recording_devs; /* Recordable devies */
130 130 unsigned int stereo_devs; /* Stereo devices */
131 131  
132   - unsigned int (*select_input)(wavnc_info *, unsigned int,
  132 + unsigned int (*select_input)(struct wavnc_info *, unsigned int,
133 133 unsigned char *, unsigned char *);
134   - int (*decode_mixer)(wavnc_info *, int,
  134 + int (*decode_mixer)(struct wavnc_info *, int,
135 135 unsigned char, unsigned char);
136   - int (*get_mixer)(wavnc_info *, int);
  136 + int (*get_mixer)(struct wavnc_info *, int);
137 137 };
138 138  
139   -typedef struct wavnc_port_info {
  139 +struct wavnc_port_info {
140 140 int open_mode;
141 141 int speed;
142 142 int channels;
143 143 int audio_format;
144   -} wavnc_port_info;
  144 +};
145 145  
146 146 static int nr_waveartist_devs;
147   -static wavnc_info adev_info[MAX_AUDIO_DEV];
  147 +static struct wavnc_info adev_info[MAX_AUDIO_DEV];
148 148 static DEFINE_SPINLOCK(waveartist_lock);
149 149  
150 150 #ifndef CONFIG_ARCH_NETWINDER
151 151 #define machine_is_netwinder() 0
152 152 #else
153 153 static struct timer_list vnc_timer;
154   -static void vnc_configure_mixer(wavnc_info *devc, unsigned int input_mask);
  154 +static void vnc_configure_mixer(struct wavnc_info *devc,
  155 + unsigned int input_mask);
155 156 static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg);
156 157 static void vnc_slider_tick(unsigned long data);
157 158 #endif
... ... @@ -169,7 +170,7 @@
169 170 /* Toggle IRQ acknowledge line
170 171 */
171 172 static inline void
172   -waveartist_iack(wavnc_info *devc)
  173 +waveartist_iack(struct wavnc_info *devc)
173 174 {
174 175 unsigned int ctlr_port = devc->hw.io_base + CTLR;
175 176 int old_ctlr;
... ... @@ -188,7 +189,7 @@
188 189 }
189 190  
190 191 static int
191   -waveartist_reset(wavnc_info *devc)
  192 +waveartist_reset(struct wavnc_info *devc)
192 193 {
193 194 struct address_info *hw = &devc->hw;
194 195 unsigned int timeout, res = -1;
... ... @@ -223,7 +224,7 @@
223 224 * and can send or receive multiple words.
224 225 */
225 226 static int
226   -waveartist_cmd(wavnc_info *devc,
  227 +waveartist_cmd(struct wavnc_info *devc,
227 228 int nr_cmd, unsigned int *cmd,
228 229 int nr_resp, unsigned int *resp)
229 230 {
... ... @@ -299,7 +300,7 @@
299 300 * Send one command word
300 301 */
301 302 static inline int
302   -waveartist_cmd1(wavnc_info *devc, unsigned int cmd)
  303 +waveartist_cmd1(struct wavnc_info *devc, unsigned int cmd)
303 304 {
304 305 return waveartist_cmd(devc, 1, &cmd, 0, NULL);
305 306 }
... ... @@ -308,7 +309,7 @@
308 309 * Send one command, receive one word
309 310 */
310 311 static inline unsigned int
311   -waveartist_cmd1_r(wavnc_info *devc, unsigned int cmd)
  312 +waveartist_cmd1_r(struct wavnc_info *devc, unsigned int cmd)
312 313 {
313 314 unsigned int ret;
314 315  
... ... @@ -322,7 +323,7 @@
322 323 * word (and throw it away)
323 324 */
324 325 static inline int
325   -waveartist_cmd2(wavnc_info *devc, unsigned int cmd, unsigned int arg)
  326 +waveartist_cmd2(struct wavnc_info *devc, unsigned int cmd, unsigned int arg)
326 327 {
327 328 unsigned int vals[2];
328 329  
... ... @@ -336,7 +337,7 @@
336 337 * Send a triple command
337 338 */
338 339 static inline int
339   -waveartist_cmd3(wavnc_info *devc, unsigned int cmd,
  340 +waveartist_cmd3(struct wavnc_info *devc, unsigned int cmd,
340 341 unsigned int arg1, unsigned int arg2)
341 342 {
342 343 unsigned int vals[3];
... ... @@ -349,7 +350,7 @@
349 350 }
350 351  
351 352 static int
352   -waveartist_getrev(wavnc_info *devc, char *rev)
  353 +waveartist_getrev(struct wavnc_info *devc, char *rev)
353 354 {
354 355 unsigned int temp[2];
355 356 unsigned int cmd = WACMD_GETREV;
356 357  
... ... @@ -371,15 +372,15 @@
371 372 static int
372 373 waveartist_open(int dev, int mode)
373 374 {
374   - wavnc_info *devc;
375   - wavnc_port_info *portc;
  375 + struct wavnc_info *devc;
  376 + struct wavnc_port_info *portc;
376 377 unsigned long flags;
377 378  
378 379 if (dev < 0 || dev >= num_audiodevs)
379 380 return -ENXIO;
380 381  
381   - devc = (wavnc_info *) audio_devs[dev]->devc;
382   - portc = (wavnc_port_info *) audio_devs[dev]->portc;
  382 + devc = (struct wavnc_info *) audio_devs[dev]->devc;
  383 + portc = (struct wavnc_port_info *) audio_devs[dev]->portc;
383 384  
384 385 spin_lock_irqsave(&waveartist_lock, flags);
385 386 if (portc->open_mode || (devc->open_mode & mode)) {
... ... @@ -404,8 +405,10 @@
404 405 static void
405 406 waveartist_close(int dev)
406 407 {
407   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
408   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  408 + struct wavnc_info *devc = (struct wavnc_info *)
  409 + audio_devs[dev]->devc;
  410 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  411 + audio_devs[dev]->portc;
409 412 unsigned long flags;
410 413  
411 414 spin_lock_irqsave(&waveartist_lock, flags);
... ... @@ -422,8 +425,10 @@
422 425 static void
423 426 waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag)
424 427 {
425   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
426   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
  428 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  429 + audio_devs[dev]->portc;
  430 + struct wavnc_info *devc = (struct wavnc_info *)
  431 + audio_devs[dev]->devc;
427 432 unsigned long flags;
428 433 unsigned int count = __count;
429 434  
... ... @@ -467,8 +472,10 @@
467 472 static void
468 473 waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag)
469 474 {
470   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
471   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
  475 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  476 + audio_devs[dev]->portc;
  477 + struct wavnc_info *devc = (struct wavnc_info *)
  478 + audio_devs[dev]->devc;
472 479 unsigned long flags;
473 480 unsigned int count = __count;
474 481  
... ... @@ -514,7 +521,7 @@
514 521 }
515 522  
516 523 static unsigned int
517   -waveartist_get_speed(wavnc_port_info *portc)
  524 +waveartist_get_speed(struct wavnc_port_info *portc)
518 525 {
519 526 unsigned int speed;
520 527  
... ... @@ -542,7 +549,7 @@
542 549 }
543 550  
544 551 static unsigned int
545   -waveartist_get_bits(wavnc_port_info *portc)
  552 +waveartist_get_bits(struct wavnc_port_info *portc)
546 553 {
547 554 unsigned int bits;
548 555  
... ... @@ -560,8 +567,10 @@
560 567 waveartist_prepare_for_input(int dev, int bsize, int bcount)
561 568 {
562 569 unsigned long flags;
563   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
564   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  570 + struct wavnc_info *devc = (struct wavnc_info *)
  571 + audio_devs[dev]->devc;
  572 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  573 + audio_devs[dev]->portc;
565 574 unsigned int speed, bits;
566 575  
567 576 if (devc->audio_mode)
... ... @@ -615,8 +624,10 @@
615 624 waveartist_prepare_for_output(int dev, int bsize, int bcount)
616 625 {
617 626 unsigned long flags;
618   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
619   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  627 + struct wavnc_info *devc = (struct wavnc_info *)
  628 + audio_devs[dev]->devc;
  629 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  630 + audio_devs[dev]->portc;
620 631 unsigned int speed, bits;
621 632  
622 633 /*
... ... @@ -660,8 +671,9 @@
660 671 static void
661 672 waveartist_halt(int dev)
662 673 {
663   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
664   - wavnc_info *devc;
  674 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  675 + audio_devs[dev]->portc;
  676 + struct wavnc_info *devc;
665 677  
666 678 if (portc->open_mode & OPEN_WRITE)
667 679 waveartist_halt_output(dev);
668 680  
... ... @@ -669,14 +681,15 @@
669 681 if (portc->open_mode & OPEN_READ)
670 682 waveartist_halt_input(dev);
671 683  
672   - devc = (wavnc_info *) audio_devs[dev]->devc;
  684 + devc = (struct wavnc_info *) audio_devs[dev]->devc;
673 685 devc->audio_mode = 0;
674 686 }
675 687  
676 688 static void
677 689 waveartist_halt_input(int dev)
678 690 {
679   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
  691 + struct wavnc_info *devc = (struct wavnc_info *)
  692 + audio_devs[dev]->devc;
680 693 unsigned long flags;
681 694  
682 695 spin_lock_irqsave(&waveartist_lock, flags);
... ... @@ -703,7 +716,8 @@
703 716 static void
704 717 waveartist_halt_output(int dev)
705 718 {
706   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
  719 + struct wavnc_info *devc = (struct wavnc_info *)
  720 + audio_devs[dev]->devc;
707 721 unsigned long flags;
708 722  
709 723 spin_lock_irqsave(&waveartist_lock, flags);
... ... @@ -727,8 +741,10 @@
727 741 static void
728 742 waveartist_trigger(int dev, int state)
729 743 {
730   - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
731   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  744 + struct wavnc_info *devc = (struct wavnc_info *)
  745 + audio_devs[dev]->devc;
  746 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  747 + audio_devs[dev]->portc;
732 748 unsigned long flags;
733 749  
734 750 if (debug_flg & DEBUG_TRIGGER) {
... ... @@ -764,7 +780,8 @@
764 780 static int
765 781 waveartist_set_speed(int dev, int arg)
766 782 {
767   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  783 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  784 + audio_devs[dev]->portc;
768 785  
769 786 if (arg <= 0)
770 787 return portc->speed;
... ... @@ -782,7 +799,8 @@
782 799 static short
783 800 waveartist_set_channels(int dev, short arg)
784 801 {
785   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  802 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  803 + audio_devs[dev]->portc;
786 804  
787 805 if (arg != 1 && arg != 2)
788 806 return portc->channels;
... ... @@ -794,7 +812,8 @@
794 812 static unsigned int
795 813 waveartist_set_bits(int dev, unsigned int arg)
796 814 {
797   - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
  815 + struct wavnc_port_info *portc = (struct wavnc_port_info *)
  816 + audio_devs[dev]->portc;
798 817  
799 818 if (arg == 0)
800 819 return portc->audio_format;
... ... @@ -829,7 +848,7 @@
829 848 static irqreturn_t
830 849 waveartist_intr(int irq, void *dev_id)
831 850 {
832   - wavnc_info *devc = dev_id;
  851 + struct wavnc_info *devc = dev_id;
833 852 int irqstatus, status;
834 853  
835 854 spin_lock(&waveartist_lock);
... ... @@ -912,7 +931,7 @@
912 931 };
913 932  
914 933 static void
915   -waveartist_mixer_update(wavnc_info *devc, int whichDev)
  934 +waveartist_mixer_update(struct wavnc_info *devc, int whichDev)
916 935 {
917 936 unsigned int lev_left, lev_right;
918 937  
... ... @@ -973,7 +992,8 @@
973 992 * relevant *_select_input function has done that for us.
974 993 */
975 994 static void
976   -waveartist_set_adc_mux(wavnc_info *devc, char left_dev, char right_dev)
  995 +waveartist_set_adc_mux(struct wavnc_info *devc, char left_dev,
  996 + char right_dev)
977 997 {
978 998 unsigned int reg_08, reg_09;
979 999  
... ... @@ -996,7 +1016,7 @@
996 1016 * SOUND_MASK_MIC Mic Microphone
997 1017 */
998 1018 static unsigned int
999   -waveartist_select_input(wavnc_info *devc, unsigned int recmask,
  1019 +waveartist_select_input(struct wavnc_info *devc, unsigned int recmask,
1000 1020 unsigned char *dev_l, unsigned char *dev_r)
1001 1021 {
1002 1022 unsigned int recdev = ADC_MUX_NONE;
... ... @@ -1024,7 +1044,8 @@
1024 1044 }
1025 1045  
1026 1046 static int
1027   -waveartist_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
  1047 +waveartist_decode_mixer(struct wavnc_info *devc, int dev,
  1048 + unsigned char lev_l,
1028 1049 unsigned char lev_r)
1029 1050 {
1030 1051 switch (dev) {
... ... @@ -1050,7 +1071,7 @@
1050 1071 return dev;
1051 1072 }
1052 1073  
1053   -static int waveartist_get_mixer(wavnc_info *devc, int dev)
  1074 +static int waveartist_get_mixer(struct wavnc_info *devc, int dev)
1054 1075 {
1055 1076 return devc->levels[dev];
1056 1077 }
... ... @@ -1068,7 +1089,7 @@
1068 1089 };
1069 1090  
1070 1091 static void
1071   -waveartist_set_recmask(wavnc_info *devc, unsigned int recmask)
  1092 +waveartist_set_recmask(struct wavnc_info *devc, unsigned int recmask)
1072 1093 {
1073 1094 unsigned char dev_l, dev_r;
1074 1095  
... ... @@ -1092,7 +1113,7 @@
1092 1113 }
1093 1114  
1094 1115 static int
1095   -waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level)
  1116 +waveartist_set_mixer(struct wavnc_info *devc, int dev, unsigned int level)
1096 1117 {
1097 1118 unsigned int lev_left = level & 0x00ff;
1098 1119 unsigned int lev_right = (level & 0xff00) >> 8;
... ... @@ -1120,7 +1141,7 @@
1120 1141 static int
1121 1142 waveartist_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
1122 1143 {
1123   - wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
  1144 + struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc;
1124 1145 int ret = 0, val, nr;
1125 1146  
1126 1147 /*
... ... @@ -1204,7 +1225,7 @@
1204 1225 };
1205 1226  
1206 1227 static void
1207   -waveartist_mixer_reset(wavnc_info *devc)
  1228 +waveartist_mixer_reset(struct wavnc_info *devc)
1208 1229 {
1209 1230 int i;
1210 1231  
1211 1232  
... ... @@ -1241,9 +1262,9 @@
1241 1262 waveartist_mixer_update(devc, i);
1242 1263 }
1243 1264  
1244   -static int __init waveartist_init(wavnc_info *devc)
  1265 +static int __init waveartist_init(struct wavnc_info *devc)
1245 1266 {
1246   - wavnc_port_info *portc;
  1267 + struct wavnc_port_info *portc;
1247 1268 char rev[3], dev_name[64];
1248 1269 int my_dev;
1249 1270  
... ... @@ -1261,7 +1282,7 @@
1261 1282 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq,
1262 1283 devc->hw.dma, devc->hw.dma2);
1263 1284  
1264   - portc = kzalloc(sizeof(wavnc_port_info), GFP_KERNEL);
  1285 + portc = kzalloc(sizeof(struct wavnc_port_info), GFP_KERNEL);
1265 1286 if (portc == NULL)
1266 1287 goto nomem;
1267 1288  
... ... @@ -1330,7 +1351,7 @@
1330 1351  
1331 1352 static int __init probe_waveartist(struct address_info *hw_config)
1332 1353 {
1333   - wavnc_info *devc = &adev_info[nr_waveartist_devs];
  1354 + struct wavnc_info *devc = &adev_info[nr_waveartist_devs];
1334 1355  
1335 1356 if (nr_waveartist_devs >= MAX_AUDIO_DEV) {
1336 1357 printk(KERN_WARNING "waveartist: too many audio devices\n");
... ... @@ -1367,7 +1388,7 @@
1367 1388 static void __init
1368 1389 attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *mix)
1369 1390 {
1370   - wavnc_info *devc = &adev_info[nr_waveartist_devs];
  1391 + struct wavnc_info *devc = &adev_info[nr_waveartist_devs];
1371 1392  
1372 1393 /*
1373 1394 * NOTE! If irq < 0, there is another driver which has allocated the
... ... @@ -1410,7 +1431,7 @@
1410 1431  
1411 1432 static void __exit unload_waveartist(struct address_info *hw)
1412 1433 {
1413   - wavnc_info *devc = NULL;
  1434 + struct wavnc_info *devc = NULL;
1414 1435 int i;
1415 1436  
1416 1437 for (i = 0; i < nr_waveartist_devs; i++)
... ... @@ -1478,7 +1499,7 @@
1478 1499 #define VNC_DISABLE_AUTOSWITCH 0x80
1479 1500  
1480 1501 static inline void
1481   -vnc_mute_spkr(wavnc_info *devc)
  1502 +vnc_mute_spkr(struct wavnc_info *devc)
1482 1503 {
1483 1504 unsigned long flags;
1484 1505  
... ... @@ -1488,7 +1509,7 @@
1488 1509 }
1489 1510  
1490 1511 static void
1491   -vnc_mute_lout(wavnc_info *devc)
  1512 +vnc_mute_lout(struct wavnc_info *devc)
1492 1513 {
1493 1514 unsigned int left, right;
1494 1515  
... ... @@ -1507,7 +1528,7 @@
1507 1528 }
1508 1529  
1509 1530 static int
1510   -vnc_volume_slider(wavnc_info *devc)
  1531 +vnc_volume_slider(struct wavnc_info *devc)
1511 1532 {
1512 1533 static signed int old_slider_volume;
1513 1534 unsigned long flags;
... ... @@ -1567,7 +1588,7 @@
1567 1588 * SOUND_MASK_MIC Right Mic Builtin microphone
1568 1589 */
1569 1590 static unsigned int
1570   -netwinder_select_input(wavnc_info *devc, unsigned int recmask,
  1591 +netwinder_select_input(struct wavnc_info *devc, unsigned int recmask,
1571 1592 unsigned char *dev_l, unsigned char *dev_r)
1572 1593 {
1573 1594 unsigned int recdev_l = ADC_MUX_NONE, recdev_r = ADC_MUX_NONE;
... ... @@ -1604,7 +1625,7 @@
1604 1625 }
1605 1626  
1606 1627 static int
1607   -netwinder_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
  1628 +netwinder_decode_mixer(struct wavnc_info *devc, int dev, unsigned char lev_l,
1608 1629 unsigned char lev_r)
1609 1630 {
1610 1631 switch (dev) {
... ... @@ -1643,7 +1664,7 @@
1643 1664 return dev;
1644 1665 }
1645 1666  
1646   -static int netwinder_get_mixer(wavnc_info *devc, int dev)
  1667 +static int netwinder_get_mixer(struct wavnc_info *devc, int dev)
1647 1668 {
1648 1669 int levels;
1649 1670  
... ... @@ -1703,7 +1724,7 @@
1703 1724 };
1704 1725  
1705 1726 static void
1706   -vnc_configure_mixer(wavnc_info *devc, unsigned int recmask)
  1727 +vnc_configure_mixer(struct wavnc_info *devc, unsigned int recmask)
1707 1728 {
1708 1729 if (!devc->no_autoselect) {
1709 1730 if (devc->handset_detect) {
... ... @@ -1729,7 +1750,7 @@
1729 1750 }
1730 1751  
1731 1752 static int
1732   -vnc_slider(wavnc_info *devc)
  1753 +vnc_slider(struct wavnc_info *devc)
1733 1754 {
1734 1755 signed int slider_volume;
1735 1756 unsigned int temp, old_hs, old_td;
... ... @@ -1795,7 +1816,7 @@
1795 1816 static int
1796 1817 vnc_private_ioctl(int dev, unsigned int cmd, int __user * arg)
1797 1818 {
1798   - wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
  1819 + struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc;
1799 1820 int val;
1800 1821  
1801 1822 switch (cmd) {