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

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>

authored by

Himangi Saraogi and committed by
Takashi Iwai
68a9edd1 80e7bbac

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