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

ALSA: ctxfi - Remove useless initializations and cast

Remove useless variable initializations and cast at the beginning of
functions.

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

+301 -297
+31 -31
sound/pci/ctxfi/ctamixer.c
··· 58 58 59 59 static int amixer_set_input(struct amixer *amixer, struct rsc *rsc) 60 60 { 61 - struct hw *hw = NULL; 61 + struct hw *hw; 62 62 63 - hw = (struct hw *)amixer->rsc.hw; 63 + hw = amixer->rsc.hw; 64 64 hw->amixer_set_mode(amixer->rsc.ctrl_blk, AMIXER_Y_IMMEDIATE); 65 65 amixer->input = rsc; 66 66 if (NULL == rsc) ··· 75 75 /* y is a 14-bit immediate constant */ 76 76 static int amixer_set_y(struct amixer *amixer, unsigned int y) 77 77 { 78 - struct hw *hw = NULL; 78 + struct hw *hw; 79 79 80 - hw = (struct hw *)amixer->rsc.hw; 80 + hw = amixer->rsc.hw; 81 81 hw->amixer_set_y(amixer->rsc.ctrl_blk, y); 82 82 83 83 return 0; ··· 85 85 86 86 static int amixer_set_invalid_squash(struct amixer *amixer, unsigned int iv) 87 87 { 88 - struct hw *hw = NULL; 88 + struct hw *hw; 89 89 90 - hw = (struct hw *)amixer->rsc.hw; 90 + hw = amixer->rsc.hw; 91 91 hw->amixer_set_iv(amixer->rsc.ctrl_blk, iv); 92 92 93 93 return 0; ··· 95 95 96 96 static int amixer_set_sum(struct amixer *amixer, struct sum *sum) 97 97 { 98 - struct hw *hw = NULL; 98 + struct hw *hw; 99 99 100 - hw = (struct hw *)amixer->rsc.hw; 100 + hw = amixer->rsc.hw; 101 101 amixer->sum = sum; 102 102 if (NULL == sum) { 103 103 hw->amixer_set_se(amixer->rsc.ctrl_blk, 0); ··· 112 112 113 113 static int amixer_commit_write(struct amixer *amixer) 114 114 { 115 - struct hw *hw = NULL; 116 - unsigned int index = 0; 117 - int i = 0; 118 - struct rsc *input = NULL; 119 - struct sum *sum = NULL; 115 + struct hw *hw; 116 + unsigned int index; 117 + int i; 118 + struct rsc *input; 119 + struct sum *sum; 120 120 121 - hw = (struct hw *)amixer->rsc.hw; 121 + hw = amixer->rsc.hw; 122 122 input = amixer->input; 123 123 sum = amixer->sum; 124 124 ··· 158 158 159 159 static int amixer_commit_raw_write(struct amixer *amixer) 160 160 { 161 - struct hw *hw = NULL; 162 - unsigned int index = 0; 161 + struct hw *hw; 162 + unsigned int index; 163 163 164 - hw = (struct hw *)amixer->rsc.hw; 164 + hw = amixer->rsc.hw; 165 165 index = amixer->rsc.ops->output_slot(&amixer->rsc); 166 166 hw->amixer_commit_write(hw, index, amixer->rsc.ctrl_blk); 167 167 ··· 170 170 171 171 static int amixer_get_y(struct amixer *amixer) 172 172 { 173 - struct hw *hw = NULL; 173 + struct hw *hw; 174 174 175 - hw = (struct hw *)amixer->rsc.hw; 175 + hw = amixer->rsc.hw; 176 176 return hw->amixer_get_y(amixer->rsc.ctrl_blk); 177 177 } 178 178 ··· 201 201 const struct amixer_desc *desc, 202 202 struct amixer_mgr *mgr) 203 203 { 204 - int err = 0; 204 + int err; 205 205 206 206 err = rsc_init(&amixer->rsc, amixer->idx[0], 207 207 AMIXER, desc->msr, mgr->mgr.hw); ··· 233 233 const struct amixer_desc *desc, 234 234 struct amixer **ramixer) 235 235 { 236 - int err = 0, i = 0; 237 - unsigned int idx = 0; 238 - struct amixer *amixer = NULL; 236 + int err, i; 237 + unsigned int idx; 238 + struct amixer *amixer; 239 239 unsigned long flags; 240 240 241 241 *ramixer = NULL; ··· 284 284 static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer) 285 285 { 286 286 unsigned long flags; 287 - int i = 0; 287 + int i; 288 288 289 289 spin_lock_irqsave(&mgr->mgr_lock, flags); 290 290 for (i = 0; i < amixer->rsc.msr; i++) ··· 299 299 300 300 int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr) 301 301 { 302 - int err = 0; 302 + int err; 303 303 struct amixer_mgr *amixer_mgr; 304 304 305 305 *ramixer_mgr = NULL; ··· 367 367 const struct sum_desc *desc, 368 368 struct sum_mgr *mgr) 369 369 { 370 - int err = 0; 370 + int err; 371 371 372 372 err = rsc_init(&sum->rsc, sum->idx[0], SUM, desc->msr, mgr->mgr.hw); 373 373 if (err) ··· 388 388 const struct sum_desc *desc, 389 389 struct sum **rsum) 390 390 { 391 - int err = 0, i = 0; 392 - unsigned int idx = 0; 393 - struct sum *sum = NULL; 391 + int err, i; 392 + unsigned int idx; 393 + struct sum *sum; 394 394 unsigned long flags; 395 395 396 396 *rsum = NULL; ··· 438 438 static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) 439 439 { 440 440 unsigned long flags; 441 - int i = 0; 441 + int i; 442 442 443 443 spin_lock_irqsave(&mgr->mgr_lock, flags); 444 444 for (i = 0; i < sum->rsc.msr; i++) ··· 453 453 454 454 int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr) 455 455 { 456 - int err = 0; 456 + int err; 457 457 struct sum_mgr *sum_mgr; 458 458 459 459 *rsum_mgr = NULL;
+84 -80
sound/pci/ctxfi/ctatc.c
··· 190 190 static unsigned int 191 191 atc_get_pitch(unsigned int input_rate, unsigned int output_rate) 192 192 { 193 - unsigned int pitch = 0; 194 - int b = 0; 193 + unsigned int pitch; 194 + int b; 195 195 196 196 /* get pitch and convert to fixed-point 8.24 format. */ 197 197 pitch = (input_rate / output_rate) << 24; ··· 241 241 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; 242 242 struct src_desc desc = {0}; 243 243 struct amixer_desc mix_dsc = {0}; 244 - struct src *src = NULL; 245 - struct amixer *amixer = NULL; 246 - int err = 0; 244 + struct src *src; 245 + struct amixer *amixer; 246 + int err; 247 247 int n_amixer = apcm->substream->runtime->channels, i = 0; 248 248 int device = apcm->substream->pcm->device; 249 - unsigned int pitch = 0; 249 + unsigned int pitch; 250 250 unsigned long flags; 251 251 252 252 if (NULL != apcm->src) { ··· 324 324 struct srcimp_mgr *srcimp_mgr = atc->rsc_mgrs[SRCIMP]; 325 325 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; 326 326 struct sum_mgr *sum_mgr = atc->rsc_mgrs[SUM]; 327 - struct srcimp *srcimp = NULL; 328 - int i = 0; 327 + struct srcimp *srcimp; 328 + int i; 329 329 330 330 if (NULL != apcm->srcimps) { 331 331 for (i = 0; i < apcm->n_srcimp; i++) { ··· 377 377 378 378 static int atc_pcm_playback_start(struct ct_atc *atc, struct ct_atc_pcm *apcm) 379 379 { 380 - unsigned int max_cisz = 0; 380 + unsigned int max_cisz; 381 381 struct src *src = apcm->src; 382 382 383 383 max_cisz = src->multi * src->rsc.msr; ··· 398 398 399 399 static int atc_pcm_stop(struct ct_atc *atc, struct ct_atc_pcm *apcm) 400 400 { 401 - struct src *src = NULL; 402 - int i = 0; 401 + struct src *src; 402 + int i; 403 403 404 404 ct_timer_stop(apcm->timer); 405 405 ··· 426 426 atc_pcm_playback_position(struct ct_atc *atc, struct ct_atc_pcm *apcm) 427 427 { 428 428 struct src *src = apcm->src; 429 - u32 size = 0, max_cisz = 0; 430 - int position = 0; 429 + u32 size, max_cisz; 430 + int position; 431 431 432 432 position = src->ops->get_ca(src); 433 433 ··· 449 449 static void setup_src_node_conf(struct ct_atc *atc, struct ct_atc_pcm *apcm, 450 450 struct src_node_conf_t *conf, int *n_srcc) 451 451 { 452 - unsigned int pitch = 0; 452 + unsigned int pitch; 453 453 454 454 /* get pitch and convert to fixed-point 8.24 format. */ 455 455 pitch = atc_get_pitch((atc->rsr * atc->msr), ··· 494 494 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; 495 495 struct sum_mgr *sum_mgr = atc->rsc_mgrs[SUM]; 496 496 struct src_desc src_dsc = {0}; 497 - struct src *src = NULL; 497 + struct src *src; 498 498 struct srcimp_desc srcimp_dsc = {0}; 499 - struct srcimp *srcimp = NULL; 499 + struct srcimp *srcimp; 500 500 struct amixer_desc mix_dsc = {0}; 501 501 struct sum_desc sum_dsc = {0}; 502 - unsigned int pitch = 0; 503 - int multi = 0, err = 0, i = 0; 504 - int n_srcimp = 0, n_amixer = 0, n_srcc = 0, n_sum = 0; 502 + unsigned int pitch; 503 + int multi, err, i; 504 + int n_srcimp, n_amixer, n_srcc, n_sum; 505 505 struct src_node_conf_t src_node_conf[2] = {{0} }; 506 506 507 507 /* first release old resources */ ··· 518 518 519 519 setup_src_node_conf(atc, apcm, src_node_conf, &n_srcc); 520 520 n_sum = (1 == multi) ? 1 : 0; 521 - n_amixer += n_sum * 2 + n_srcc; 522 - n_srcimp += n_srcc; 521 + n_amixer = n_sum * 2 + n_srcc; 522 + n_srcimp = n_srcc; 523 523 if ((multi > 1) && (0x8000000 >= pitch)) { 524 524 /* Need extra AMIXERs and SRCIMPs for special treatment 525 525 * of interleaved recording of conjugate channels */ ··· 633 633 634 634 static int atc_pcm_capture_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) 635 635 { 636 - struct src *src = NULL; 637 - struct amixer *amixer = NULL; 638 - struct srcimp *srcimp = NULL; 636 + struct src *src; 637 + struct amixer *amixer; 638 + struct srcimp *srcimp; 639 639 struct ct_mixer *mixer = atc->mixer; 640 - struct sum *mono = NULL; 640 + struct sum *mono; 641 641 struct rsc *out_ports[8] = {NULL}; 642 - int err = 0, i = 0, j = 0, n_sum = 0, multi = 0; 643 - unsigned int pitch = 0; 642 + int err, i, j, n_sum, multi; 643 + unsigned int pitch; 644 644 int mix_base = 0, imp_base = 0; 645 645 646 646 if (NULL != apcm->src) { ··· 714 714 715 715 static int atc_pcm_capture_start(struct ct_atc *atc, struct ct_atc_pcm *apcm) 716 716 { 717 - struct src *src = NULL; 717 + struct src *src; 718 718 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; 719 - int i = 0, multi = 0; 719 + int i, multi; 720 720 721 721 if (apcm->started) 722 722 return 0; ··· 776 776 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; 777 777 struct src_desc desc = {0}; 778 778 struct amixer_desc mix_dsc = {0}; 779 - struct src *src = NULL; 780 - int err = 0; 781 - int n_amixer = apcm->substream->runtime->channels, i = 0; 782 - unsigned int pitch = 0, rsr = atc->pll_rate; 779 + struct src *src; 780 + int err; 781 + int n_amixer = apcm->substream->runtime->channels, i; 782 + unsigned int pitch, rsr = atc->pll_rate; 783 783 784 784 /* first release old resources */ 785 785 atc->pcm_release_resources(atc, apcm); ··· 832 832 return err; 833 833 } 834 834 835 + static int atc_pll_init(struct ct_atc *atc, int rate) 836 + { 837 + struct hw *hw = atc->hw; 838 + int err; 839 + err = hw->pll_init(hw, rate); 840 + atc->pll_rate = err ? 0 : rate; 841 + return err; 842 + } 843 + 835 844 static int 836 845 spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm) 837 846 { 838 847 struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio); 839 848 unsigned long flags; 840 849 unsigned int rate = apcm->substream->runtime->rate; 841 - unsigned int status = 0; 842 - int err = 0; 843 - unsigned char iec958_con_fs = 0; 850 + unsigned int status; 851 + int err; 852 + unsigned char iec958_con_fs; 844 853 845 854 switch (rate) { 846 855 case 48000: ··· 873 864 dao->ops->set_spos(dao, status); 874 865 dao->ops->commit_write(dao); 875 866 } 876 - if ((rate != atc->pll_rate) && (32000 != rate)) { 877 - err = ((struct hw *)atc->hw)->pll_init(atc->hw, rate); 878 - atc->pll_rate = err ? 0 : rate; 879 - } 867 + if ((rate != atc->pll_rate) && (32000 != rate)) 868 + err = atc_pll_init(atc, rate); 880 869 spin_unlock_irqrestore(&atc->atc_lock, flags); 881 870 882 871 return err; ··· 883 876 static int 884 877 spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) 885 878 { 886 - struct src *src = NULL; 887 - struct amixer *amixer = NULL; 888 - struct dao *dao = NULL; 889 - int err = 0; 890 - int i = 0; 879 + struct src *src; 880 + struct amixer *amixer; 881 + struct dao *dao; 882 + int err; 883 + int i; 891 884 unsigned long flags; 892 885 893 886 if (NULL != apcm->src) ··· 931 924 { 932 925 struct hw *hw = atc->hw; 933 926 struct ct_mixer *mixer = atc->mixer; 934 - struct src *src = NULL; 927 + struct src *src; 935 928 936 929 if (hw->is_adc_source_selected(hw, ADC_LINEIN)) 937 930 return 0; ··· 953 946 { 954 947 struct hw *hw = atc->hw; 955 948 struct ct_mixer *mixer = atc->mixer; 956 - struct src *src = NULL; 949 + struct src *src; 957 950 958 951 if (hw->is_adc_source_selected(hw, ADC_MICIN)) 959 952 return 0; ··· 1070 1063 { 1071 1064 unsigned long flags; 1072 1065 struct dao_desc da_dsc = {0}; 1073 - struct dao *dao = NULL; 1074 - int err = 0; 1066 + struct dao *dao; 1067 + int err; 1075 1068 struct ct_mixer *mixer = atc->mixer; 1076 1069 struct rsc *rscs[2] = {NULL}; 1077 1070 unsigned int spos = 0; ··· 1089 1082 dao->ops->set_left_input(dao, rscs[0]); 1090 1083 dao->ops->set_right_input(dao, rscs[1]); 1091 1084 /* Restore PLL to atc->rsr if needed. */ 1092 - if (atc->pll_rate != atc->rsr) { 1093 - err = ((struct hw *)atc->hw)->pll_init(atc->hw, 1094 - atc->rsr); 1095 - atc->pll_rate = err ? 0 : atc->rsr; 1096 - } 1085 + if (atc->pll_rate != atc->rsr) 1086 + err = atc_pll_init(atc, atc->rsr); 1097 1087 } 1098 1088 dao->ops->set_spos(dao, spos); 1099 1089 dao->ops->commit_write(dao); ··· 1101 1097 1102 1098 static int ct_atc_destroy(struct ct_atc *atc) 1103 1099 { 1104 - struct daio_mgr *daio_mgr = NULL; 1105 - struct dao *dao = NULL; 1106 - struct dai *dai = NULL; 1107 - struct daio *daio = NULL; 1108 - struct sum_mgr *sum_mgr = NULL; 1109 - struct src_mgr *src_mgr = NULL; 1110 - struct srcimp_mgr *srcimp_mgr = NULL; 1111 - struct srcimp *srcimp = NULL; 1112 - struct ct_mixer *mixer = NULL; 1100 + struct daio_mgr *daio_mgr; 1101 + struct dao *dao; 1102 + struct dai *dai; 1103 + struct daio *daio; 1104 + struct sum_mgr *sum_mgr; 1105 + struct src_mgr *src_mgr; 1106 + struct srcimp_mgr *srcimp_mgr; 1107 + struct srcimp *srcimp; 1108 + struct ct_mixer *mixer; 1113 1109 int i = 0; 1114 1110 1115 1111 if (NULL == atc) ··· 1283 1279 1284 1280 static int __devinit atc_create_hw_devs(struct ct_atc *atc) 1285 1281 { 1286 - struct hw *hw = NULL; 1282 + struct hw *hw; 1287 1283 struct card_conf info = {0}; 1288 - int i = 0, err = 0; 1284 + int i, err; 1289 1285 1290 1286 err = create_hw_obj(atc->pci, &hw); 1291 1287 if (err) { ··· 1320 1316 static int __devinit atc_get_resources(struct ct_atc *atc) 1321 1317 { 1322 1318 struct daio_desc da_desc = {0}; 1323 - struct daio_mgr *daio_mgr = NULL; 1319 + struct daio_mgr *daio_mgr; 1324 1320 struct src_desc src_dsc = {0}; 1325 - struct src_mgr *src_mgr = NULL; 1321 + struct src_mgr *src_mgr; 1326 1322 struct srcimp_desc srcimp_dsc = {0}; 1327 - struct srcimp_mgr *srcimp_mgr = NULL; 1323 + struct srcimp_mgr *srcimp_mgr; 1328 1324 struct sum_desc sum_dsc = {0}; 1329 - struct sum_mgr *sum_mgr = NULL; 1330 - int err = 0, i = 0; 1325 + struct sum_mgr *sum_mgr; 1326 + int err, i; 1331 1327 unsigned short subsys_id; 1332 1328 1333 1329 atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL); ··· 1432 1428 struct src **srcs, struct srcimp **srcimps) 1433 1429 { 1434 1430 struct rsc *rscs[2] = {NULL}; 1435 - struct src *src = NULL; 1436 - struct srcimp *srcimp = NULL; 1431 + struct src *src; 1432 + struct srcimp *srcimp; 1437 1433 int i = 0; 1438 1434 1439 1435 rscs[0] = &dai->daio.rscl; ··· 1468 1464 1469 1465 static void __devinit atc_connect_resources(struct ct_atc *atc) 1470 1466 { 1471 - struct dai *dai = NULL; 1472 - struct dao *dao = NULL; 1473 - struct src *src = NULL; 1474 - struct sum *sum = NULL; 1475 - struct ct_mixer *mixer = NULL; 1467 + struct dai *dai; 1468 + struct dao *dao; 1469 + struct src *src; 1470 + struct sum *sum; 1471 + struct ct_mixer *mixer; 1476 1472 struct rsc *rscs[2] = {NULL}; 1477 - int i = 0, j = 0; 1473 + int i, j; 1478 1474 1479 1475 mixer = atc->mixer; 1480 1476 ··· 1557 1553 int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci, 1558 1554 unsigned int rsr, unsigned int msr, struct ct_atc **ratc) 1559 1555 { 1560 - struct ct_atc *atc = NULL; 1556 + struct ct_atc *atc; 1561 1557 static struct snd_device_ops ops = { 1562 1558 .dev_free = atc_dev_free, 1563 1559 }; 1564 - int err = 0; 1560 + int err; 1565 1561 1566 1562 *ratc = NULL; 1567 1563
+20 -20
sound/pci/ctxfi/ctdaio.c
··· 168 168 169 169 static int dao_set_left_input(struct dao *dao, struct rsc *input) 170 170 { 171 - struct imapper *entry = NULL; 171 + struct imapper *entry; 172 172 struct daio *daio = &dao->daio; 173 - int i = 0; 173 + int i; 174 174 175 175 entry = kzalloc((sizeof(*entry) * daio->rscl.msr), GFP_KERNEL); 176 176 if (NULL == entry) ··· 196 196 197 197 static int dao_set_right_input(struct dao *dao, struct rsc *input) 198 198 { 199 - struct imapper *entry = NULL; 199 + struct imapper *entry; 200 200 struct daio *daio = &dao->daio; 201 - int i = 0; 201 + int i; 202 202 203 203 entry = kzalloc((sizeof(*entry) * daio->rscr.msr), GFP_KERNEL); 204 204 if (NULL == entry) ··· 224 224 225 225 static int dao_clear_left_input(struct dao *dao) 226 226 { 227 - struct imapper *entry = NULL; 227 + struct imapper *entry; 228 228 struct daio *daio = &dao->daio; 229 - int i = 0; 229 + int i; 230 230 231 231 if (NULL == dao->imappers[0]) 232 232 return 0; ··· 248 248 249 249 static int dao_clear_right_input(struct dao *dao) 250 250 { 251 - struct imapper *entry = NULL; 251 + struct imapper *entry; 252 252 struct daio *daio = &dao->daio; 253 - int i = 0; 253 + int i; 254 254 255 255 if (NULL == dao->imappers[daio->rscl.msr]) 256 256 return 0; ··· 299 299 300 300 static int dai_set_srt_msr(struct dai *dai, unsigned int msr) 301 301 { 302 - unsigned int rsr = 0; 302 + unsigned int rsr; 303 303 304 304 for (rsr = 0; msr > 1; msr >>= 1) 305 305 rsr++; ··· 340 340 const struct daio_desc *desc, 341 341 void *hw) 342 342 { 343 - int err = 0; 344 - unsigned int idx_l = 0, idx_r = 0; 343 + int err; 344 + unsigned int idx_l, idx_r; 345 345 346 346 switch (((struct hw *)hw)->get_chip_type(hw)) { 347 347 case ATC20K1: ··· 400 400 struct daio_mgr *mgr) 401 401 { 402 402 struct hw *hw = mgr->mgr.hw; 403 - unsigned int conf = 0; 404 - int err = 0; 403 + unsigned int conf; 404 + int err; 405 405 406 406 err = daio_rsc_init(&dao->daio, desc, mgr->mgr.hw); 407 407 if (err) ··· 423 423 daio_device_index(dao->daio.type, hw)); 424 424 hw->daio_mgr_commit_write(hw, mgr->mgr.ctrl_blk); 425 425 426 - conf |= (desc->msr & 0x7) | (desc->passthru << 3); 426 + conf = (desc->msr & 0x7) | (desc->passthru << 3); 427 427 hw->daio_mgr_dao_init(mgr->mgr.ctrl_blk, 428 428 daio_device_index(dao->daio.type, hw), conf); 429 429 hw->daio_mgr_enb_dao(mgr->mgr.ctrl_blk, ··· 475 475 const struct daio_desc *desc, 476 476 struct daio_mgr *mgr) 477 477 { 478 - int err = 0; 478 + int err; 479 479 struct hw *hw = mgr->mgr.hw; 480 - unsigned int rsr = 0, msr = 0; 480 + unsigned int rsr, msr; 481 481 482 482 err = daio_rsc_init(&dai->daio, desc, mgr->mgr.hw); 483 483 if (err) ··· 536 536 const struct daio_desc *desc, 537 537 struct daio **rdaio) 538 538 { 539 - int err = 0; 539 + int err; 540 540 struct dai *dai = NULL; 541 541 struct dao *dao = NULL; 542 542 unsigned long flags; ··· 660 660 static int daio_imap_add(struct daio_mgr *mgr, struct imapper *entry) 661 661 { 662 662 unsigned long flags; 663 - int err = 0; 663 + int err; 664 664 665 665 spin_lock_irqsave(&mgr->imap_lock, flags); 666 666 if ((0 == entry->addr) && (mgr->init_imap_added)) { ··· 677 677 static int daio_imap_delete(struct daio_mgr *mgr, struct imapper *entry) 678 678 { 679 679 unsigned long flags; 680 - int err = 0; 680 + int err; 681 681 682 682 spin_lock_irqsave(&mgr->imap_lock, flags); 683 683 err = input_mapper_delete(&mgr->imappers, entry, daio_map_op, mgr); ··· 701 701 702 702 int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) 703 703 { 704 - int err = 0, i = 0; 704 + int err, i; 705 705 struct daio_mgr *daio_mgr; 706 706 struct imapper *entry; 707 707
+3 -3
sound/pci/ctxfi/cthardware.c
··· 22 22 23 23 static enum CHIPTYP __devinitdata get_chip_type(struct hw *hw) 24 24 { 25 - enum CHIPTYP type = ATCNONE; 25 + enum CHIPTYP type; 26 26 27 27 switch (hw->pci->device) { 28 28 case 0x0005: /* 20k1 device */ ··· 41 41 42 42 int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw) 43 43 { 44 - int err = 0; 44 + int err; 45 45 46 46 switch (pci->device) { 47 47 case 0x0005: /* 20k1 device */ ··· 65 65 66 66 int destroy_hw_obj(struct hw *hw) 67 67 { 68 - int err = 0; 68 + int err; 69 69 70 70 switch (hw->pci->device) { 71 71 case 0x0005: /* 20k1 device */
+41 -41
sound/pci/ctxfi/cthw20k1.c
··· 369 369 static int src_commit_write(struct hw *hw, unsigned int idx, void *blk) 370 370 { 371 371 struct src_rsc_ctrl_blk *ctl = blk; 372 - int i = 0; 372 + int i; 373 373 374 374 if (ctl->dirty.bf.czbfs) { 375 375 /* Clear Z-Buffer registers */ ··· 468 468 static int src_mgr_commit_write(struct hw *hw, void *blk) 469 469 { 470 470 struct src_mgr_ctrl_blk *ctl = blk; 471 - int i = 0; 472 - unsigned int ret = 0; 471 + int i; 472 + unsigned int ret; 473 473 474 474 if (ctl->dirty.bf.enbsa) { 475 475 do { ··· 1108 1108 static int daio_mgr_commit_write(struct hw *hw, void *blk) 1109 1109 { 1110 1110 struct daio_mgr_ctrl_blk *ctl = blk; 1111 - int i = 0; 1111 + int i; 1112 1112 1113 1113 if (ctl->dirty.bf.i2sictl || ctl->dirty.bf.i2soctl) { 1114 1114 for (i = 0; i < 4; i++) { ··· 1212 1212 1213 1213 static int hw_daio_init(struct hw *hw, const struct daio_conf *info) 1214 1214 { 1215 - u32 i2sorg = 0; 1216 - u32 spdorg = 0; 1215 + u32 i2sorg; 1216 + u32 spdorg; 1217 1217 1218 1218 /* Read I2S CTL. Keep original value. */ 1219 1219 /*i2sorg = hw_read_20kx(hw, I2SCTL);*/ ··· 1263 1263 /* TRANSPORT operations */ 1264 1264 static int hw_trn_init(struct hw *hw, const struct trn_conf *info) 1265 1265 { 1266 - u32 trnctl = 0; 1267 - unsigned long ptp_phys_low = 0, ptp_phys_high = 0; 1266 + u32 trnctl; 1267 + u32 ptp_phys_low, ptp_phys_high; 1268 1268 1269 1269 /* Set up device page table */ 1270 1270 if ((~0UL) == info->vm_pgt_phys) { ··· 1316 1316 static int hw_pll_init(struct hw *hw, unsigned int rsr) 1317 1317 { 1318 1318 unsigned int pllctl; 1319 - int i = 0; 1319 + int i; 1320 1320 1321 1321 pllctl = (48000 == rsr) ? 0x1480a001 : 0x1480a731; 1322 1322 for (i = 0; i < 3; i++) { ··· 1384 1384 1385 1385 static void i2c_write(struct hw *hw, u32 device, u32 addr, u32 data) 1386 1386 { 1387 - unsigned int ret = 0; 1387 + unsigned int ret; 1388 1388 1389 1389 do { 1390 1390 ret = hw_read_pci(hw, 0xEC); ··· 1397 1397 1398 1398 static int hw_reset_dac(struct hw *hw) 1399 1399 { 1400 - u32 i = 0; 1401 - u16 gpioorg = 0; 1402 - unsigned int ret = 0; 1400 + u32 i; 1401 + u16 gpioorg; 1402 + unsigned int ret; 1403 1403 1404 1404 if (i2c_unlock(hw)) 1405 1405 return -1; ··· 1430 1430 1431 1431 static int hw_dac_init(struct hw *hw, const struct dac_conf *info) 1432 1432 { 1433 - u32 data = 0; 1434 - u16 gpioorg = 0; 1435 - u16 subsys_id = 0; 1436 - unsigned int ret = 0; 1433 + u32 data; 1434 + u16 gpioorg; 1435 + u16 subsys_id; 1436 + unsigned int ret; 1437 1437 1438 1438 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1439 1439 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { ··· 1494 1494 1495 1495 static int is_adc_input_selected_SB055x(struct hw *hw, enum ADCSRC type) 1496 1496 { 1497 - u32 data = 0; 1498 - return data; 1497 + return 0; 1499 1498 } 1500 1499 1501 1500 static int is_adc_input_selected_SBx(struct hw *hw, enum ADCSRC type) 1502 1501 { 1503 - u32 data = 0; 1502 + u32 data; 1504 1503 1505 1504 data = hw_read_20kx(hw, GPIO); 1506 1505 switch (type) { ··· 1520 1521 1521 1522 static int is_adc_input_selected_hendrix(struct hw *hw, enum ADCSRC type) 1522 1523 { 1523 - u32 data = 0; 1524 + u32 data; 1524 1525 1525 1526 data = hw_read_20kx(hw, GPIO); 1526 1527 switch (type) { ··· 1538 1539 1539 1540 static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type) 1540 1541 { 1541 - u16 subsys_id = 0; 1542 + u16 subsys_id; 1542 1543 1543 1544 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1544 1545 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { ··· 1558 1559 static int 1559 1560 adc_input_select_SB055x(struct hw *hw, enum ADCSRC type, unsigned char boost) 1560 1561 { 1561 - u32 data = 0; 1562 + u32 data; 1562 1563 1563 1564 /* 1564 1565 * check and set the following GPIO bits accordingly ··· 1598 1599 static int 1599 1600 adc_input_select_SBx(struct hw *hw, enum ADCSRC type, unsigned char boost) 1600 1601 { 1601 - u32 data = 0; 1602 - u32 i2c_data = 0; 1603 - unsigned int ret = 0; 1602 + u32 data; 1603 + u32 i2c_data; 1604 + unsigned int ret; 1604 1605 1605 1606 if (i2c_unlock(hw)) 1606 1607 return -1; ··· 1648 1649 static int 1649 1650 adc_input_select_hendrix(struct hw *hw, enum ADCSRC type, unsigned char boost) 1650 1651 { 1651 - u32 data = 0; 1652 - u32 i2c_data = 0; 1653 - unsigned int ret = 0; 1652 + u32 data; 1653 + u32 i2c_data; 1654 + unsigned int ret; 1654 1655 1655 1656 if (i2c_unlock(hw)) 1656 1657 return -1; ··· 1692 1693 1693 1694 static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) 1694 1695 { 1695 - u16 subsys_id = 0; 1696 + u16 subsys_id; 1696 1697 1697 1698 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1698 1699 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { ··· 1718 1719 { 1719 1720 u16 gpioorg; 1720 1721 u16 input_source; 1721 - u32 adcdata = 0; 1722 - unsigned int ret = 0; 1722 + u32 adcdata; 1723 + unsigned int ret; 1723 1724 1724 1725 input_source = 0x100; /* default to analog */ 1725 1726 switch (input) { ··· 1741 1742 input_source = 0x0; /* set to Digital */ 1742 1743 break; 1743 1744 default: 1745 + adcdata = 0x0; 1744 1746 break; 1745 1747 } 1746 1748 ··· 1781 1781 1782 1782 static int hw_adc_init(struct hw *hw, const struct adc_conf *info) 1783 1783 { 1784 - int err = 0; 1785 - u16 subsys_id = 0; 1784 + int err; 1785 + u16 subsys_id; 1786 1786 1787 1787 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1788 1788 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { ··· 1797 1797 1798 1798 static int hw_have_digit_io_switch(struct hw *hw) 1799 1799 { 1800 - u16 subsys_id = 0; 1800 + u16 subsys_id; 1801 1801 1802 1802 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1803 1803 /* SB073x and Vista compatible cards have no digit IO switch */ ··· 1814 1814 { 1815 1815 unsigned int bar0, bar1, bar2, bar3, bar4, bar5; 1816 1816 unsigned int cmd, irq, cl_size, l_timer, pwr; 1817 - unsigned int is_uaa = 0; 1817 + unsigned int is_uaa; 1818 1818 unsigned int data[4] = {0}; 1819 1819 unsigned int io_base; 1820 1820 void *mem_base; 1821 - int i = 0; 1821 + int i; 1822 1822 const u32 CTLX = CTLBITS('C', 'T', 'L', 'X'); 1823 1823 const u32 CTL_ = CTLBITS('C', 'T', 'L', '-'); 1824 1824 const u32 CTLF = CTLBITS('C', 'T', 'L', 'F'); ··· 1916 1916 1917 1917 static int hw_card_start(struct hw *hw) 1918 1918 { 1919 - int err = 0; 1919 + int err; 1920 1920 struct pci_dev *pci = hw->pci; 1921 - u16 subsys_id = 0; 1921 + u16 subsys_id; 1922 1922 1923 1923 err = pci_enable_device(pci); 1924 1924 if (err < 0) ··· 2004 2004 { 2005 2005 int err; 2006 2006 unsigned int gctl; 2007 - u16 subsys_id = 0; 2008 - u32 data = 0; 2007 + u16 subsys_id; 2008 + u32 data; 2009 2009 struct dac_conf dac_info = {0}; 2010 2010 struct adc_conf adc_info = {0}; 2011 2011 struct daio_conf daio_info = {0};
+26 -26
sound/pci/ctxfi/cthw20k2.c
··· 168 168 169 169 static int src_put_rsc_ctrl_blk(void *blk) 170 170 { 171 - kfree((struct src_rsc_ctrl_blk *)blk); 171 + kfree(blk); 172 172 173 173 return 0; 174 174 } ··· 359 359 static int src_commit_write(struct hw *hw, unsigned int idx, void *blk) 360 360 { 361 361 struct src_rsc_ctrl_blk *ctl = blk; 362 - int i = 0; 362 + int i; 363 363 364 364 if (ctl->dirty.bf.czbfs) { 365 365 /* Clear Z-Buffer registers */ ··· 458 458 static int src_mgr_commit_write(struct hw *hw, void *blk) 459 459 { 460 460 struct src_mgr_ctrl_blk *ctl = blk; 461 - int i = 0; 462 - unsigned int ret = 0; 461 + int i; 462 + unsigned int ret; 463 463 464 464 if (ctl->dirty.bf.enbsa) { 465 465 do { ··· 494 494 495 495 static int src_mgr_put_ctrl_blk(void *blk) 496 496 { 497 - kfree((struct src_mgr_ctrl_blk *)blk); 497 + kfree(blk); 498 498 499 499 return 0; 500 500 } ··· 515 515 516 516 static int srcimp_mgr_put_ctrl_blk(void *blk) 517 517 { 518 - kfree((struct srcimp_mgr_ctrl_blk *)blk); 518 + kfree(blk); 519 519 520 520 return 0; 521 521 } ··· 704 704 705 705 static int amixer_rsc_put_ctrl_blk(void *blk) 706 706 { 707 - kfree((struct amixer_rsc_ctrl_blk *)blk); 707 + kfree(blk); 708 708 709 709 return 0; 710 710 } ··· 893 893 894 894 static int dai_put_ctrl_blk(void *blk) 895 895 { 896 - kfree((struct dai_ctrl_blk *)blk); 896 + kfree(blk); 897 897 898 898 return 0; 899 899 } ··· 943 943 944 944 static int dao_put_ctrl_blk(void *blk) 945 945 { 946 - kfree((struct dao_ctrl_blk *)blk); 946 + kfree(blk); 947 947 948 948 return 0; 949 949 } ··· 1051 1051 static int daio_mgr_commit_write(struct hw *hw, void *blk) 1052 1052 { 1053 1053 struct daio_mgr_ctrl_blk *ctl = blk; 1054 - unsigned int data = 0; 1055 - int i = 0; 1054 + unsigned int data; 1055 + int i; 1056 1056 1057 1057 for (i = 0; i < 8; i++) { 1058 1058 if ((ctl->dirty.bf.atxctl & (0x1 << i))) { ··· 1080 1080 static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk) 1081 1081 { 1082 1082 struct daio_mgr_ctrl_blk *blk; 1083 - int i = 0; 1083 + int i; 1084 1084 1085 1085 *rblk = NULL; 1086 1086 blk = kzalloc(sizeof(*blk), GFP_KERNEL); ··· 1099 1099 1100 1100 static int daio_mgr_put_ctrl_blk(void *blk) 1101 1101 { 1102 - kfree((struct daio_mgr_ctrl_blk *)blk); 1102 + kfree(blk); 1103 1103 1104 1104 return 0; 1105 1105 } ··· 1125 1125 1126 1126 static int hw_daio_init(struct hw *hw, const struct daio_conf *info) 1127 1127 { 1128 - u32 dwData = 0; 1128 + u32 dwData; 1129 1129 int i; 1130 1130 1131 1131 /* Program I2S with proper sample rate and enable the correct I2S ··· 1195 1195 /* TRANSPORT operations */ 1196 1196 static int hw_trn_init(struct hw *hw, const struct trn_conf *info) 1197 1197 { 1198 - u32 vmctl = 0, data = 0; 1199 - unsigned long ptp_phys_low = 0, ptp_phys_high = 0; 1200 - int i = 0; 1198 + u32 vmctl, data; 1199 + u32 ptp_phys_low, ptp_phys_high; 1200 + int i; 1201 1201 1202 1202 /* Set up device page table */ 1203 1203 if ((~0UL) == info->vm_pgt_phys) { ··· 1433 1433 1434 1434 static int I2CInit(struct hw *hw, u8 bDeviceID, u8 bAddressSize, u8 bDataSize) 1435 1435 { 1436 - int err = 0; 1436 + int err; 1437 1437 unsigned int RegI2CStatus; 1438 1438 unsigned int RegI2CAddress; 1439 1439 ··· 1481 1481 static int I2CWaitDataReady(struct hw *hw) 1482 1482 { 1483 1483 int i = 0x400000; 1484 - unsigned int ret = 0; 1484 + unsigned int ret; 1485 1485 1486 1486 do { 1487 1487 ret = hw_read_20kx(hw, I2C_IF_STATUS); ··· 1541 1541 1542 1542 static int hw_dac_init(struct hw *hw, const struct dac_conf *info) 1543 1543 { 1544 - int err = 0; 1545 - u32 dwData = 0; 1546 - int i = 0; 1544 + int err; 1545 + u32 dwData; 1546 + int i; 1547 1547 struct REGS_CS4382 cs4382_Read = {0}; 1548 1548 struct REGS_CS4382 cs4382_Def = { 1549 1549 0x00000001, /* Mode Control 1 */ ··· 1696 1696 1697 1697 static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type) 1698 1698 { 1699 - u32 data = 0; 1699 + u32 data; 1700 1700 1701 1701 data = hw_read_20kx(hw, GPIO_DATA); 1702 1702 switch (type) { ··· 1714 1714 1715 1715 static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) 1716 1716 { 1717 - u32 data = 0; 1717 + u32 data; 1718 1718 1719 1719 data = hw_read_20kx(hw, GPIO_DATA); 1720 1720 switch (type) { ··· 1747 1747 1748 1748 static int hw_adc_init(struct hw *hw, const struct adc_conf *info) 1749 1749 { 1750 - int err = 0; 1751 - u32 dwMux = 2, dwData = 0, dwCtl = 0; 1750 + int err; 1751 + u32 dwMux = 2, dwData, dwCtl; 1752 1752 1753 1753 /* Set ADC reset bit as output */ 1754 1754 dwData = hw_read_20kx(hw, GPIO_CTRL);
+2 -2
sound/pci/ctxfi/ctimap.c
··· 99 99 100 100 void free_input_mapper_list(struct list_head *head) 101 101 { 102 - struct imapper *entry = NULL; 103 - struct list_head *pos = NULL; 102 + struct imapper *entry; 103 + struct list_head *pos; 104 104 105 105 while (!list_empty(head)) { 106 106 pos = head->next;
+30 -30
sound/pci/ctxfi/ctmixer.c
··· 298 298 * from 2^-6 to (1+1023/1024) */ 299 299 static unsigned int uint16_to_float14(unsigned int x) 300 300 { 301 - unsigned int i = 0; 301 + unsigned int i; 302 302 303 303 if (x < 17) 304 304 return 0; ··· 318 318 319 319 static unsigned int float14_to_uint16(unsigned int x) 320 320 { 321 - unsigned int e = 0; 321 + unsigned int e; 322 322 323 323 if (!x) 324 324 return x; ··· 491 491 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 492 492 struct ct_mixer *mixer = atc->mixer; 493 493 enum CTALSA_MIXER_CTL type = kcontrol->private_value; 494 - int state = 0; 494 + int state; 495 495 496 496 state = ucontrol->value.integer.value[0]; 497 497 if (get_switch_state(mixer, type) == state) ··· 574 574 struct snd_ctl_elem_value *ucontrol) 575 575 { 576 576 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 577 - unsigned int status = 0; 577 + unsigned int status; 578 578 579 579 atc->spdif_out_get_status(atc, &status); 580 580 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff; ··· 589 589 struct snd_ctl_elem_value *ucontrol) 590 590 { 591 591 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 592 - int change = 1; 593 - unsigned int status = 0, old_status = 0; 592 + int change; 593 + unsigned int status, old_status; 594 594 595 595 status = (ucontrol->value.iec958.status[0] << 0) | 596 596 (ucontrol->value.iec958.status[1] << 8) | ··· 641 641 static int 642 642 ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new) 643 643 { 644 - struct snd_kcontrol *kctl = NULL; 645 - int err = 0; 644 + struct snd_kcontrol *kctl; 645 + int err; 646 646 647 647 kctl = snd_ctl_new1(new, mixer->atc); 648 648 if (NULL == kctl) ··· 669 669 670 670 static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) 671 671 { 672 - enum CTALSA_MIXER_CTL type = 0; 672 + enum CTALSA_MIXER_CTL type; 673 673 struct ct_atc *atc = mixer->atc; 674 - int err = 0; 674 + int err; 675 675 676 676 /* Create snd kcontrol instances on demand */ 677 677 for (type = VOL_MIXER_START; type <= VOL_MIXER_END; type++) { ··· 733 733 static void 734 734 ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type) 735 735 { 736 - struct amixer *amix_d = NULL; 737 - struct sum *sum_c = NULL; 738 - int i = 0; 736 + struct amixer *amix_d; 737 + struct sum *sum_c; 738 + int i; 739 739 740 740 for (i = 0; i < 2; i++) { 741 741 amix_d = mixer->amixers[type*CHN_NUM+i]; ··· 748 748 static void 749 749 ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type) 750 750 { 751 - struct amixer *amix_d = NULL; 752 - int i = 0; 751 + struct amixer *amix_d; 752 + int i; 753 753 754 754 for (i = 0; i < 2; i++) { 755 755 amix_d = mixer->amixers[type*CHN_NUM+i]; ··· 760 760 761 761 static int ct_mixer_get_resources(struct ct_mixer *mixer) 762 762 { 763 - struct sum_mgr *sum_mgr = NULL; 764 - struct sum *sum = NULL; 763 + struct sum_mgr *sum_mgr; 764 + struct sum *sum; 765 765 struct sum_desc sum_desc = {0}; 766 - struct amixer_mgr *amixer_mgr = NULL; 767 - struct amixer *amixer = NULL; 766 + struct amixer_mgr *amixer_mgr; 767 + struct amixer *amixer; 768 768 struct amixer_desc am_desc = {0}; 769 - int err = 0; 770 - int i = 0; 769 + int err; 770 + int i; 771 771 772 772 /* Allocate sum resources for mixer obj */ 773 773 sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; ··· 822 822 823 823 static int ct_mixer_get_mem(struct ct_mixer **rmixer) 824 824 { 825 - struct ct_mixer *mixer = NULL; 826 - int err = 0; 825 + struct ct_mixer *mixer; 826 + int err; 827 827 828 828 *rmixer = NULL; 829 829 /* Allocate mem for mixer obj */ ··· 855 855 856 856 static int ct_mixer_topology_build(struct ct_mixer *mixer) 857 857 { 858 - struct sum *sum = NULL; 859 - struct amixer *amix_d = NULL, *amix_s = NULL; 860 - enum CT_AMIXER_CTL i = 0, j = 0; 858 + struct sum *sum; 859 + struct amixer *amix_d, *amix_s; 860 + enum CT_AMIXER_CTL i, j; 861 861 862 862 /* Build topology from destination to source */ 863 863 ··· 1044 1044 struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; 1045 1045 struct amixer_mgr *amixer_mgr = 1046 1046 (struct amixer_mgr *)mixer->atc->rsc_mgrs[AMIXER]; 1047 - struct amixer *amixer = NULL; 1047 + struct amixer *amixer; 1048 1048 int i = 0; 1049 1049 1050 1050 /* Release amixer resources */ ··· 1071 1071 1072 1072 int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer) 1073 1073 { 1074 - struct ct_mixer *mixer = NULL; 1075 - int err = 0; 1074 + struct ct_mixer *mixer; 1075 + int err; 1076 1076 1077 1077 *rmixer = NULL; 1078 1078 ··· 1109 1109 enum CTALSADEVS device, 1110 1110 const char *device_name) 1111 1111 { 1112 - int err = 0; 1112 + int err; 1113 1113 1114 1114 /* Create snd kcontrol instances on demand */ 1115 1115 /* vol_ctl.device = swh_ctl.device = device; */ /* better w/ device 0 */
+3 -3
sound/pci/ctxfi/ctresource.c
··· 27 27 get_resource(u8 *rscs, unsigned int amount, 28 28 unsigned int multi, unsigned int *ridx) 29 29 { 30 - int i = 0, j = 0, k = 0, n = 0; 30 + int i, j, k, n; 31 31 32 32 /* Check whether there are sufficient resources to meet request. */ 33 33 for (i = 0, n = multi; i < amount; i++) { ··· 61 61 62 62 static int put_resource(u8 *rscs, unsigned int multi, unsigned int idx) 63 63 { 64 - unsigned int i = 0, j = 0, k = 0, n = 0; 64 + unsigned int i, j, k, n; 65 65 66 66 /* Mark the contiguous bits in resource bit-map as used */ 67 67 for (n = multi, i = idx; n > 0; n--) { ··· 76 76 77 77 int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx) 78 78 { 79 - int err = 0; 79 + int err; 80 80 81 81 if (n > mgr->avail) 82 82 return -ENOENT;
+55 -55
sound/pci/ctxfi/ctsrc.c
··· 37 37 38 38 static int src_set_state(struct src *src, unsigned int state) 39 39 { 40 - struct hw *hw = NULL; 40 + struct hw *hw; 41 41 42 - hw = (struct hw *)src->rsc.hw; 42 + hw = src->rsc.hw; 43 43 hw->src_set_state(src->rsc.ctrl_blk, state); 44 44 45 45 return 0; ··· 47 47 48 48 static int src_set_bm(struct src *src, unsigned int bm) 49 49 { 50 - struct hw *hw = NULL; 50 + struct hw *hw; 51 51 52 - hw = (struct hw *)src->rsc.hw; 52 + hw = src->rsc.hw; 53 53 hw->src_set_bm(src->rsc.ctrl_blk, bm); 54 54 55 55 return 0; ··· 57 57 58 58 static int src_set_sf(struct src *src, unsigned int sf) 59 59 { 60 - struct hw *hw = NULL; 60 + struct hw *hw; 61 61 62 - hw = (struct hw *)src->rsc.hw; 62 + hw = src->rsc.hw; 63 63 hw->src_set_sf(src->rsc.ctrl_blk, sf); 64 64 65 65 return 0; ··· 67 67 68 68 static int src_set_pm(struct src *src, unsigned int pm) 69 69 { 70 - struct hw *hw = NULL; 70 + struct hw *hw; 71 71 72 - hw = (struct hw *)src->rsc.hw; 72 + hw = src->rsc.hw; 73 73 hw->src_set_pm(src->rsc.ctrl_blk, pm); 74 74 75 75 return 0; ··· 77 77 78 78 static int src_set_rom(struct src *src, unsigned int rom) 79 79 { 80 - struct hw *hw = NULL; 80 + struct hw *hw; 81 81 82 - hw = (struct hw *)src->rsc.hw; 82 + hw = src->rsc.hw; 83 83 hw->src_set_rom(src->rsc.ctrl_blk, rom); 84 84 85 85 return 0; ··· 87 87 88 88 static int src_set_vo(struct src *src, unsigned int vo) 89 89 { 90 - struct hw *hw = NULL; 90 + struct hw *hw; 91 91 92 - hw = (struct hw *)src->rsc.hw; 92 + hw = src->rsc.hw; 93 93 hw->src_set_vo(src->rsc.ctrl_blk, vo); 94 94 95 95 return 0; ··· 97 97 98 98 static int src_set_st(struct src *src, unsigned int st) 99 99 { 100 - struct hw *hw = NULL; 100 + struct hw *hw; 101 101 102 - hw = (struct hw *)src->rsc.hw; 102 + hw = src->rsc.hw; 103 103 hw->src_set_st(src->rsc.ctrl_blk, st); 104 104 105 105 return 0; ··· 107 107 108 108 static int src_set_bp(struct src *src, unsigned int bp) 109 109 { 110 - struct hw *hw = NULL; 110 + struct hw *hw; 111 111 112 - hw = (struct hw *)src->rsc.hw; 112 + hw = src->rsc.hw; 113 113 hw->src_set_bp(src->rsc.ctrl_blk, bp); 114 114 115 115 return 0; ··· 117 117 118 118 static int src_set_cisz(struct src *src, unsigned int cisz) 119 119 { 120 - struct hw *hw = NULL; 120 + struct hw *hw; 121 121 122 - hw = (struct hw *)src->rsc.hw; 122 + hw = src->rsc.hw; 123 123 hw->src_set_cisz(src->rsc.ctrl_blk, cisz); 124 124 125 125 return 0; ··· 127 127 128 128 static int src_set_ca(struct src *src, unsigned int ca) 129 129 { 130 - struct hw *hw = NULL; 130 + struct hw *hw; 131 131 132 - hw = (struct hw *)src->rsc.hw; 132 + hw = src->rsc.hw; 133 133 hw->src_set_ca(src->rsc.ctrl_blk, ca); 134 134 135 135 return 0; ··· 137 137 138 138 static int src_set_sa(struct src *src, unsigned int sa) 139 139 { 140 - struct hw *hw = NULL; 140 + struct hw *hw; 141 141 142 - hw = (struct hw *)src->rsc.hw; 142 + hw = src->rsc.hw; 143 143 hw->src_set_sa(src->rsc.ctrl_blk, sa); 144 144 145 145 return 0; ··· 147 147 148 148 static int src_set_la(struct src *src, unsigned int la) 149 149 { 150 - struct hw *hw = NULL; 150 + struct hw *hw; 151 151 152 - hw = (struct hw *)src->rsc.hw; 152 + hw = src->rsc.hw; 153 153 hw->src_set_la(src->rsc.ctrl_blk, la); 154 154 155 155 return 0; ··· 157 157 158 158 static int src_set_pitch(struct src *src, unsigned int pitch) 159 159 { 160 - struct hw *hw = NULL; 160 + struct hw *hw; 161 161 162 - hw = (struct hw *)src->rsc.hw; 162 + hw = src->rsc.hw; 163 163 hw->src_set_pitch(src->rsc.ctrl_blk, pitch); 164 164 165 165 return 0; ··· 167 167 168 168 static int src_set_clear_zbufs(struct src *src) 169 169 { 170 - struct hw *hw = NULL; 170 + struct hw *hw; 171 171 172 - hw = (struct hw *)src->rsc.hw; 172 + hw = src->rsc.hw; 173 173 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1); 174 174 175 175 return 0; ··· 177 177 178 178 static int src_commit_write(struct src *src) 179 179 { 180 - struct hw *hw = NULL; 181 - int i = 0; 180 + struct hw *hw; 181 + int i; 182 182 unsigned int dirty = 0; 183 183 184 - hw = (struct hw *)src->rsc.hw; 184 + hw = src->rsc.hw; 185 185 src->rsc.ops->master(&src->rsc); 186 186 if (src->rsc.msr > 1) { 187 187 /* Save dirty flags for conjugate resource programming */ ··· 207 207 208 208 static int src_get_ca(struct src *src) 209 209 { 210 - struct hw *hw = NULL; 210 + struct hw *hw; 211 211 212 - hw = (struct hw *)src->rsc.hw; 212 + hw = src->rsc.hw; 213 213 return hw->src_get_ca(hw, src->rsc.ops->index(&src->rsc), 214 214 src->rsc.ctrl_blk); 215 215 } ··· 229 229 static int src_default_config_memrd(struct src *src) 230 230 { 231 231 struct hw *hw = src->rsc.hw; 232 - unsigned int rsr = 0, msr = 0; 232 + unsigned int rsr, msr; 233 233 234 234 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); 235 235 hw->src_set_bm(src->rsc.ctrl_blk, 1); ··· 297 297 static int src_default_config_arcrw(struct src *src) 298 298 { 299 299 struct hw *hw = src->rsc.hw; 300 - unsigned int rsr = 0, msr = 0; 300 + unsigned int rsr, msr; 301 301 unsigned int dirty; 302 302 303 303 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF); ··· 360 360 src_rsc_init(struct src *src, u32 idx, 361 361 const struct src_desc *desc, struct src_mgr *mgr) 362 362 { 363 - int err = 0; 364 - int i = 0, n = 0; 363 + int err; 364 + int i, n; 365 365 struct src *p; 366 366 367 367 n = (MEMRD == desc->mode) ? desc->multi : 1; ··· 395 395 396 396 static int src_rsc_uninit(struct src *src, struct src_mgr *mgr) 397 397 { 398 - int i = 0, n = 0; 398 + int i, n; 399 399 struct src *p; 400 400 401 401 n = (MEMRD == src->mode) ? src->multi : 1; ··· 416 416 get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc) 417 417 { 418 418 unsigned int idx = SRC_RESOURCE_NUM; 419 - int err = 0; 420 - struct src *src = NULL; 419 + int err; 420 + struct src *src; 421 421 unsigned long flags; 422 422 423 423 *rsrc = NULL; ··· 489 489 static int src_enable_s(struct src_mgr *mgr, struct src *src) 490 490 { 491 491 struct hw *hw = mgr->mgr.hw; 492 - int i = 0; 492 + int i; 493 493 494 494 src->rsc.ops->master(&src->rsc); 495 495 for (i = 0; i < src->rsc.msr; i++) { ··· 505 505 static int src_enable(struct src_mgr *mgr, struct src *src) 506 506 { 507 507 struct hw *hw = mgr->mgr.hw; 508 - int i = 0; 508 + int i; 509 509 510 510 src->rsc.ops->master(&src->rsc); 511 511 for (i = 0; i < src->rsc.msr; i++) { ··· 521 521 static int src_disable(struct src_mgr *mgr, struct src *src) 522 522 { 523 523 struct hw *hw = mgr->mgr.hw; 524 - int i = 0; 524 + int i; 525 525 526 526 src->rsc.ops->master(&src->rsc); 527 527 for (i = 0; i < src->rsc.msr; i++) { ··· 545 545 546 546 int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr) 547 547 { 548 - int err = 0, i = 0; 548 + int err, i; 549 549 struct src_mgr *src_mgr; 550 550 551 551 *rsrc_mgr = NULL; ··· 618 618 619 619 static int srcimp_map(struct srcimp *srcimp, struct src *src, struct rsc *input) 620 620 { 621 - struct imapper *entry = NULL; 622 - int i = 0; 621 + struct imapper *entry; 622 + int i; 623 623 624 624 srcimp->rsc.ops->master(&srcimp->rsc); 625 625 src->rsc.ops->master(&src->rsc); ··· 646 646 647 647 static int srcimp_unmap(struct srcimp *srcimp) 648 648 { 649 - int i = 0; 649 + int i; 650 650 651 651 /* Program master and conjugate resources */ 652 652 for (i = 0; i < srcimp->rsc.msr; i++) { ··· 669 669 const struct srcimp_desc *desc, 670 670 struct srcimp_mgr *mgr) 671 671 { 672 - int err = 0; 672 + int err; 673 673 674 674 err = rsc_init(&srcimp->rsc, srcimp->idx[0], 675 675 SRCIMP, desc->msr, mgr->mgr.hw); ··· 715 715 const struct srcimp_desc *desc, 716 716 struct srcimp **rsrcimp) 717 717 { 718 - int err = 0, i = 0; 719 - unsigned int idx = 0; 720 - struct srcimp *srcimp = NULL; 718 + int err, i; 719 + unsigned int idx; 720 + struct srcimp *srcimp; 721 721 unsigned long flags; 722 722 723 723 *rsrcimp = NULL; ··· 765 765 static int put_srcimp_rsc(struct srcimp_mgr *mgr, struct srcimp *srcimp) 766 766 { 767 767 unsigned long flags; 768 - int i = 0; 768 + int i; 769 769 770 770 spin_lock_irqsave(&mgr->mgr_lock, flags); 771 771 for (i = 0; i < srcimp->rsc.msr; i++) ··· 795 795 static int srcimp_imap_add(struct srcimp_mgr *mgr, struct imapper *entry) 796 796 { 797 797 unsigned long flags; 798 - int err = 0; 798 + int err; 799 799 800 800 spin_lock_irqsave(&mgr->imap_lock, flags); 801 801 if ((0 == entry->addr) && (mgr->init_imap_added)) { ··· 812 812 static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) 813 813 { 814 814 unsigned long flags; 815 - int err = 0; 815 + int err; 816 816 817 817 spin_lock_irqsave(&mgr->imap_lock, flags); 818 818 err = input_mapper_delete(&mgr->imappers, entry, srcimp_map_op, mgr); ··· 828 828 829 829 int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr) 830 830 { 831 - int err = 0; 831 + int err; 832 832 struct srcimp_mgr *srcimp_mgr; 833 833 struct imapper *entry; 834 834
+6 -6
sound/pci/ctxfi/ctvmem.c
··· 31 31 static struct ct_vm_block * 32 32 get_vm_block(struct ct_vm *vm, unsigned int size) 33 33 { 34 - struct ct_vm_block *block = NULL, *entry = NULL; 35 - struct list_head *pos = NULL; 34 + struct ct_vm_block *block = NULL, *entry; 35 + struct list_head *pos; 36 36 37 37 size = CT_PAGE_ALIGN(size); 38 38 if (size > vm->size) { ··· 77 77 78 78 static void put_vm_block(struct ct_vm *vm, struct ct_vm_block *block) 79 79 { 80 - struct ct_vm_block *entry = NULL, *pre_ent = NULL; 81 - struct list_head *pos = NULL, *pre = NULL; 80 + struct ct_vm_block *entry, *pre_ent; 81 + struct list_head *pos, *pre; 82 82 83 83 block->size = CT_PAGE_ALIGN(block->size); 84 84 ··· 223 223 void ct_vm_destroy(struct ct_vm *vm) 224 224 { 225 225 int i; 226 - struct list_head *pos = NULL; 227 - struct ct_vm_block *entry = NULL; 226 + struct list_head *pos; 227 + struct ct_vm_block *entry; 228 228 229 229 /* free used and unused list nodes */ 230 230 while (!list_empty(&vm->used)) {