aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctmixer.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-08 08:57:57 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-08 08:57:57 -0400
commit514eef9c2a711b4c24b97bb456d39695a6fe1775 (patch)
tree0d98fb13304707682faa56d136249e9177a54932 /sound/pci/ctxfi/ctmixer.c
parent4836ac655410e7f126d316b0be062b38746f7529 (diff)
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>
Diffstat (limited to 'sound/pci/ctxfi/ctmixer.c')
-rw-r--r--sound/pci/ctxfi/ctmixer.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c
index 796156e4bd38..666722d9de41 100644
--- a/sound/pci/ctxfi/ctmixer.c
+++ b/sound/pci/ctxfi/ctmixer.c
@@ -298,7 +298,7 @@ set_switch_state(struct ct_mixer *mixer,
298 * from 2^-6 to (1+1023/1024) */ 298 * from 2^-6 to (1+1023/1024) */
299static unsigned int uint16_to_float14(unsigned int x) 299static unsigned int uint16_to_float14(unsigned int x)
300{ 300{
301 unsigned int i = 0; 301 unsigned int i;
302 302
303 if (x < 17) 303 if (x < 17)
304 return 0; 304 return 0;
@@ -318,7 +318,7 @@ static unsigned int uint16_to_float14(unsigned int x)
318 318
319static unsigned int float14_to_uint16(unsigned int x) 319static unsigned int float14_to_uint16(unsigned int x)
320{ 320{
321 unsigned int e = 0; 321 unsigned int e;
322 322
323 if (!x) 323 if (!x)
324 return x; 324 return x;
@@ -491,7 +491,7 @@ static int ct_alsa_mix_switch_put(struct snd_kcontrol *kcontrol,
491 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 491 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);
492 struct ct_mixer *mixer = atc->mixer; 492 struct ct_mixer *mixer = atc->mixer;
493 enum CTALSA_MIXER_CTL type = kcontrol->private_value; 493 enum CTALSA_MIXER_CTL type = kcontrol->private_value;
494 int state = 0; 494 int state;
495 495
496 state = ucontrol->value.integer.value[0]; 496 state = ucontrol->value.integer.value[0];
497 if (get_switch_state(mixer, type) == state) 497 if (get_switch_state(mixer, type) == state)
@@ -574,7 +574,7 @@ static int ct_spdif_get(struct snd_kcontrol *kcontrol,
574 struct snd_ctl_elem_value *ucontrol) 574 struct snd_ctl_elem_value *ucontrol)
575{ 575{
576 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 576 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);
577 unsigned int status = 0; 577 unsigned int status;
578 578
579 atc->spdif_out_get_status(atc, &status); 579 atc->spdif_out_get_status(atc, &status);
580 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff; 580 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
@@ -589,8 +589,8 @@ static int ct_spdif_put(struct snd_kcontrol *kcontrol,
589 struct snd_ctl_elem_value *ucontrol) 589 struct snd_ctl_elem_value *ucontrol)
590{ 590{
591 struct ct_atc *atc = snd_kcontrol_chip(kcontrol); 591 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);
592 int change = 1; 592 int change;
593 unsigned int status = 0, old_status = 0; 593 unsigned int status, old_status;
594 594
595 status = (ucontrol->value.iec958.status[0] << 0) | 595 status = (ucontrol->value.iec958.status[0] << 0) |
596 (ucontrol->value.iec958.status[1] << 8) | 596 (ucontrol->value.iec958.status[1] << 8) |
@@ -641,8 +641,8 @@ static struct snd_kcontrol_new iec958_ctl = {
641static int 641static int
642ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new) 642ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new)
643{ 643{
644 struct snd_kcontrol *kctl = NULL; 644 struct snd_kcontrol *kctl;
645 int err = 0; 645 int err;
646 646
647 kctl = snd_ctl_new1(new, mixer->atc); 647 kctl = snd_ctl_new1(new, mixer->atc);
648 if (NULL == kctl) 648 if (NULL == kctl)
@@ -669,9 +669,9 @@ ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new)
669 669
670static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) 670static 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 struct ct_atc *atc = mixer->atc; 673 struct ct_atc *atc = mixer->atc;
674 int err = 0; 674 int err;
675 675
676 /* Create snd kcontrol instances on demand */ 676 /* Create snd kcontrol instances on demand */
677 for (type = VOL_MIXER_START; type <= VOL_MIXER_END; type++) { 677 for (type = VOL_MIXER_START; type <= VOL_MIXER_END; type++) {
@@ -733,9 +733,9 @@ static int ct_mixer_kcontrols_create(struct ct_mixer *mixer)
733static void 733static void
734ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type) 734ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
735{ 735{
736 struct amixer *amix_d = NULL; 736 struct amixer *amix_d;
737 struct sum *sum_c = NULL; 737 struct sum *sum_c;
738 int i = 0; 738 int i;
739 739
740 for (i = 0; i < 2; i++) { 740 for (i = 0; i < 2; i++) {
741 amix_d = mixer->amixers[type*CHN_NUM+i]; 741 amix_d = mixer->amixers[type*CHN_NUM+i];
@@ -748,8 +748,8 @@ ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
748static void 748static void
749ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type) 749ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
750{ 750{
751 struct amixer *amix_d = NULL; 751 struct amixer *amix_d;
752 int i = 0; 752 int i;
753 753
754 for (i = 0; i < 2; i++) { 754 for (i = 0; i < 2; i++) {
755 amix_d = mixer->amixers[type*CHN_NUM+i]; 755 amix_d = mixer->amixers[type*CHN_NUM+i];
@@ -760,14 +760,14 @@ ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
760 760
761static int ct_mixer_get_resources(struct ct_mixer *mixer) 761static int ct_mixer_get_resources(struct ct_mixer *mixer)
762{ 762{
763 struct sum_mgr *sum_mgr = NULL; 763 struct sum_mgr *sum_mgr;
764 struct sum *sum = NULL; 764 struct sum *sum;
765 struct sum_desc sum_desc = {0}; 765 struct sum_desc sum_desc = {0};
766 struct amixer_mgr *amixer_mgr = NULL; 766 struct amixer_mgr *amixer_mgr;
767 struct amixer *amixer = NULL; 767 struct amixer *amixer;
768 struct amixer_desc am_desc = {0}; 768 struct amixer_desc am_desc = {0};
769 int err = 0; 769 int err;
770 int i = 0; 770 int i;
771 771
772 /* Allocate sum resources for mixer obj */ 772 /* Allocate sum resources for mixer obj */
773 sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; 773 sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM];
@@ -822,8 +822,8 @@ error1:
822 822
823static int ct_mixer_get_mem(struct ct_mixer **rmixer) 823static int ct_mixer_get_mem(struct ct_mixer **rmixer)
824{ 824{
825 struct ct_mixer *mixer = NULL; 825 struct ct_mixer *mixer;
826 int err = 0; 826 int err;
827 827
828 *rmixer = NULL; 828 *rmixer = NULL;
829 /* Allocate mem for mixer obj */ 829 /* Allocate mem for mixer obj */
@@ -855,9 +855,9 @@ error1:
855 855
856static int ct_mixer_topology_build(struct ct_mixer *mixer) 856static int ct_mixer_topology_build(struct ct_mixer *mixer)
857{ 857{
858 struct sum *sum = NULL; 858 struct sum *sum;
859 struct amixer *amix_d = NULL, *amix_s = NULL; 859 struct amixer *amix_d, *amix_s;
860 enum CT_AMIXER_CTL i = 0, j = 0; 860 enum CT_AMIXER_CTL i, j;
861 861
862 /* Build topology from destination to source */ 862 /* Build topology from destination to source */
863 863
@@ -1044,7 +1044,7 @@ int ct_mixer_destroy(struct ct_mixer *mixer)
1044 struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; 1044 struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM];
1045 struct amixer_mgr *amixer_mgr = 1045 struct amixer_mgr *amixer_mgr =
1046 (struct amixer_mgr *)mixer->atc->rsc_mgrs[AMIXER]; 1046 (struct amixer_mgr *)mixer->atc->rsc_mgrs[AMIXER];
1047 struct amixer *amixer = NULL; 1047 struct amixer *amixer;
1048 int i = 0; 1048 int i = 0;
1049 1049
1050 /* Release amixer resources */ 1050 /* Release amixer resources */
@@ -1071,8 +1071,8 @@ int ct_mixer_destroy(struct ct_mixer *mixer)
1071 1071
1072int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer) 1072int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer)
1073{ 1073{
1074 struct ct_mixer *mixer = NULL; 1074 struct ct_mixer *mixer;
1075 int err = 0; 1075 int err;
1076 1076
1077 *rmixer = NULL; 1077 *rmixer = NULL;
1078 1078
@@ -1109,7 +1109,7 @@ int ct_alsa_mix_create(struct ct_atc *atc,
1109 enum CTALSADEVS device, 1109 enum CTALSADEVS device,
1110 const char *device_name) 1110 const char *device_name)
1111{ 1111{
1112 int err = 0; 1112 int err;
1113 1113
1114 /* Create snd kcontrol instances on demand */ 1114 /* Create snd kcontrol instances on demand */
1115 /* vol_ctl.device = swh_ctl.device = device; */ /* better w/ device 0 */ 1115 /* vol_ctl.device = swh_ctl.device = device; */ /* better w/ device 0 */