···298298 * from 2^-6 to (1+1023/1024) */299299static unsigned int uint16_to_float14(unsigned int x)300300{301301- unsigned int i = 0;301301+ unsigned int i;302302303303 if (x < 17)304304 return 0;···318318319319static unsigned int float14_to_uint16(unsigned int x)320320{321321- unsigned int e = 0;321321+ unsigned int e;322322323323 if (!x)324324 return x;···491491 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);492492 struct ct_mixer *mixer = atc->mixer;493493 enum CTALSA_MIXER_CTL type = kcontrol->private_value;494494- int state = 0;494494+ int state;495495496496 state = ucontrol->value.integer.value[0];497497 if (get_switch_state(mixer, type) == state)···574574 struct snd_ctl_elem_value *ucontrol)575575{576576 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);577577- unsigned int status = 0;577577+ unsigned int status;578578579579 atc->spdif_out_get_status(atc, &status);580580 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;···589589 struct snd_ctl_elem_value *ucontrol)590590{591591 struct ct_atc *atc = snd_kcontrol_chip(kcontrol);592592- int change = 1;593593- unsigned int status = 0, old_status = 0;592592+ int change;593593+ unsigned int status, old_status;594594595595 status = (ucontrol->value.iec958.status[0] << 0) |596596 (ucontrol->value.iec958.status[1] << 8) |···641641static int642642ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new)643643{644644- struct snd_kcontrol *kctl = NULL;645645- int err = 0;644644+ struct snd_kcontrol *kctl;645645+ int err;646646647647 kctl = snd_ctl_new1(new, mixer->atc);648648 if (NULL == kctl)···669669670670static int ct_mixer_kcontrols_create(struct ct_mixer *mixer)671671{672672- enum CTALSA_MIXER_CTL type = 0;672672+ enum CTALSA_MIXER_CTL type;673673 struct ct_atc *atc = mixer->atc;674674- int err = 0;674674+ int err;675675676676 /* Create snd kcontrol instances on demand */677677 for (type = VOL_MIXER_START; type <= VOL_MIXER_END; type++) {···733733static void734734ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)735735{736736- struct amixer *amix_d = NULL;737737- struct sum *sum_c = NULL;738738- int i = 0;736736+ struct amixer *amix_d;737737+ struct sum *sum_c;738738+ int i;739739740740 for (i = 0; i < 2; i++) {741741 amix_d = mixer->amixers[type*CHN_NUM+i];···748748static void749749ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)750750{751751- struct amixer *amix_d = NULL;752752- int i = 0;751751+ struct amixer *amix_d;752752+ int i;753753754754 for (i = 0; i < 2; i++) {755755 amix_d = mixer->amixers[type*CHN_NUM+i];···760760761761static int ct_mixer_get_resources(struct ct_mixer *mixer)762762{763763- struct sum_mgr *sum_mgr = NULL;764764- struct sum *sum = NULL;763763+ struct sum_mgr *sum_mgr;764764+ struct sum *sum;765765 struct sum_desc sum_desc = {0};766766- struct amixer_mgr *amixer_mgr = NULL;767767- struct amixer *amixer = NULL;766766+ struct amixer_mgr *amixer_mgr;767767+ struct amixer *amixer;768768 struct amixer_desc am_desc = {0};769769- int err = 0;770770- int i = 0;769769+ int err;770770+ int i;771771772772 /* Allocate sum resources for mixer obj */773773 sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM];···822822823823static int ct_mixer_get_mem(struct ct_mixer **rmixer)824824{825825- struct ct_mixer *mixer = NULL;826826- int err = 0;825825+ struct ct_mixer *mixer;826826+ int err;827827828828 *rmixer = NULL;829829 /* Allocate mem for mixer obj */···855855856856static int ct_mixer_topology_build(struct ct_mixer *mixer)857857{858858- struct sum *sum = NULL;859859- struct amixer *amix_d = NULL, *amix_s = NULL;860860- enum CT_AMIXER_CTL i = 0, j = 0;858858+ struct sum *sum;859859+ struct amixer *amix_d, *amix_s;860860+ enum CT_AMIXER_CTL i, j;861861862862 /* Build topology from destination to source */863863···10441044 struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM];10451045 struct amixer_mgr *amixer_mgr =10461046 (struct amixer_mgr *)mixer->atc->rsc_mgrs[AMIXER];10471047- struct amixer *amixer = NULL;10471047+ struct amixer *amixer;10481048 int i = 0;1049104910501050 /* Release amixer resources */···1071107110721072int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer)10731073{10741074- struct ct_mixer *mixer = NULL;10751075- int err = 0;10741074+ struct ct_mixer *mixer;10751075+ int err;1076107610771077 *rmixer = NULL;10781078···11091109 enum CTALSADEVS device,11101110 const char *device_name)11111111{11121112- int err = 0;11121112+ int err;1113111311141114 /* Create snd kcontrol instances on demand */11151115 /* vol_ctl.device = swh_ctl.device = device; */ /* better w/ device 0 */
+3-3
sound/pci/ctxfi/ctresource.c
···2727get_resource(u8 *rscs, unsigned int amount,2828 unsigned int multi, unsigned int *ridx)2929{3030- int i = 0, j = 0, k = 0, n = 0;3030+ int i, j, k, n;31313232 /* Check whether there are sufficient resources to meet request. */3333 for (i = 0, n = multi; i < amount; i++) {···61616262static int put_resource(u8 *rscs, unsigned int multi, unsigned int idx)6363{6464- unsigned int i = 0, j = 0, k = 0, n = 0;6464+ unsigned int i, j, k, n;65656666 /* Mark the contiguous bits in resource bit-map as used */6767 for (n = multi, i = idx; n > 0; n--) {···76767777int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx)7878{7979- int err = 0;7979+ int err;80808181 if (n > mgr->avail)8282 return -ENOENT;
+55-55
sound/pci/ctxfi/ctsrc.c
···37373838static int src_set_state(struct src *src, unsigned int state)3939{4040- struct hw *hw = NULL;4040+ struct hw *hw;41414242- hw = (struct hw *)src->rsc.hw;4242+ hw = src->rsc.hw;4343 hw->src_set_state(src->rsc.ctrl_blk, state);44444545 return 0;···47474848static int src_set_bm(struct src *src, unsigned int bm)4949{5050- struct hw *hw = NULL;5050+ struct hw *hw;51515252- hw = (struct hw *)src->rsc.hw;5252+ hw = src->rsc.hw;5353 hw->src_set_bm(src->rsc.ctrl_blk, bm);54545555 return 0;···57575858static int src_set_sf(struct src *src, unsigned int sf)5959{6060- struct hw *hw = NULL;6060+ struct hw *hw;61616262- hw = (struct hw *)src->rsc.hw;6262+ hw = src->rsc.hw;6363 hw->src_set_sf(src->rsc.ctrl_blk, sf);64646565 return 0;···67676868static int src_set_pm(struct src *src, unsigned int pm)6969{7070- struct hw *hw = NULL;7070+ struct hw *hw;71717272- hw = (struct hw *)src->rsc.hw;7272+ hw = src->rsc.hw;7373 hw->src_set_pm(src->rsc.ctrl_blk, pm);74747575 return 0;···77777878static int src_set_rom(struct src *src, unsigned int rom)7979{8080- struct hw *hw = NULL;8080+ struct hw *hw;81818282- hw = (struct hw *)src->rsc.hw;8282+ hw = src->rsc.hw;8383 hw->src_set_rom(src->rsc.ctrl_blk, rom);84848585 return 0;···87878888static int src_set_vo(struct src *src, unsigned int vo)8989{9090- struct hw *hw = NULL;9090+ struct hw *hw;91919292- hw = (struct hw *)src->rsc.hw;9292+ hw = src->rsc.hw;9393 hw->src_set_vo(src->rsc.ctrl_blk, vo);94949595 return 0;···97979898static int src_set_st(struct src *src, unsigned int st)9999{100100- struct hw *hw = NULL;100100+ struct hw *hw;101101102102- hw = (struct hw *)src->rsc.hw;102102+ hw = src->rsc.hw;103103 hw->src_set_st(src->rsc.ctrl_blk, st);104104105105 return 0;···107107108108static int src_set_bp(struct src *src, unsigned int bp)109109{110110- struct hw *hw = NULL;110110+ struct hw *hw;111111112112- hw = (struct hw *)src->rsc.hw;112112+ hw = src->rsc.hw;113113 hw->src_set_bp(src->rsc.ctrl_blk, bp);114114115115 return 0;···117117118118static int src_set_cisz(struct src *src, unsigned int cisz)119119{120120- struct hw *hw = NULL;120120+ struct hw *hw;121121122122- hw = (struct hw *)src->rsc.hw;122122+ hw = src->rsc.hw;123123 hw->src_set_cisz(src->rsc.ctrl_blk, cisz);124124125125 return 0;···127127128128static int src_set_ca(struct src *src, unsigned int ca)129129{130130- struct hw *hw = NULL;130130+ struct hw *hw;131131132132- hw = (struct hw *)src->rsc.hw;132132+ hw = src->rsc.hw;133133 hw->src_set_ca(src->rsc.ctrl_blk, ca);134134135135 return 0;···137137138138static int src_set_sa(struct src *src, unsigned int sa)139139{140140- struct hw *hw = NULL;140140+ struct hw *hw;141141142142- hw = (struct hw *)src->rsc.hw;142142+ hw = src->rsc.hw;143143 hw->src_set_sa(src->rsc.ctrl_blk, sa);144144145145 return 0;···147147148148static int src_set_la(struct src *src, unsigned int la)149149{150150- struct hw *hw = NULL;150150+ struct hw *hw;151151152152- hw = (struct hw *)src->rsc.hw;152152+ hw = src->rsc.hw;153153 hw->src_set_la(src->rsc.ctrl_blk, la);154154155155 return 0;···157157158158static int src_set_pitch(struct src *src, unsigned int pitch)159159{160160- struct hw *hw = NULL;160160+ struct hw *hw;161161162162- hw = (struct hw *)src->rsc.hw;162162+ hw = src->rsc.hw;163163 hw->src_set_pitch(src->rsc.ctrl_blk, pitch);164164165165 return 0;···167167168168static int src_set_clear_zbufs(struct src *src)169169{170170- struct hw *hw = NULL;170170+ struct hw *hw;171171172172- hw = (struct hw *)src->rsc.hw;172172+ hw = src->rsc.hw;173173 hw->src_set_clear_zbufs(src->rsc.ctrl_blk, 1);174174175175 return 0;···177177178178static int src_commit_write(struct src *src)179179{180180- struct hw *hw = NULL;181181- int i = 0;180180+ struct hw *hw;181181+ int i;182182 unsigned int dirty = 0;183183184184- hw = (struct hw *)src->rsc.hw;184184+ hw = src->rsc.hw;185185 src->rsc.ops->master(&src->rsc);186186 if (src->rsc.msr > 1) {187187 /* Save dirty flags for conjugate resource programming */···207207208208static int src_get_ca(struct src *src)209209{210210- struct hw *hw = NULL;210210+ struct hw *hw;211211212212- hw = (struct hw *)src->rsc.hw;212212+ hw = src->rsc.hw;213213 return hw->src_get_ca(hw, src->rsc.ops->index(&src->rsc),214214 src->rsc.ctrl_blk);215215}···229229static int src_default_config_memrd(struct src *src)230230{231231 struct hw *hw = src->rsc.hw;232232- unsigned int rsr = 0, msr = 0;232232+ unsigned int rsr, msr;233233234234 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF);235235 hw->src_set_bm(src->rsc.ctrl_blk, 1);···297297static int src_default_config_arcrw(struct src *src)298298{299299 struct hw *hw = src->rsc.hw;300300- unsigned int rsr = 0, msr = 0;300300+ unsigned int rsr, msr;301301 unsigned int dirty;302302303303 hw->src_set_state(src->rsc.ctrl_blk, SRC_STATE_OFF);···360360src_rsc_init(struct src *src, u32 idx,361361 const struct src_desc *desc, struct src_mgr *mgr)362362{363363- int err = 0;364364- int i = 0, n = 0;363363+ int err;364364+ int i, n;365365 struct src *p;366366367367 n = (MEMRD == desc->mode) ? desc->multi : 1;···395395396396static int src_rsc_uninit(struct src *src, struct src_mgr *mgr)397397{398398- int i = 0, n = 0;398398+ int i, n;399399 struct src *p;400400401401 n = (MEMRD == src->mode) ? src->multi : 1;···416416get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc)417417{418418 unsigned int idx = SRC_RESOURCE_NUM;419419- int err = 0;420420- struct src *src = NULL;419419+ int err;420420+ struct src *src;421421 unsigned long flags;422422423423 *rsrc = NULL;···489489static int src_enable_s(struct src_mgr *mgr, struct src *src)490490{491491 struct hw *hw = mgr->mgr.hw;492492- int i = 0;492492+ int i;493493494494 src->rsc.ops->master(&src->rsc);495495 for (i = 0; i < src->rsc.msr; i++) {···505505static int src_enable(struct src_mgr *mgr, struct src *src)506506{507507 struct hw *hw = mgr->mgr.hw;508508- int i = 0;508508+ int i;509509510510 src->rsc.ops->master(&src->rsc);511511 for (i = 0; i < src->rsc.msr; i++) {···521521static int src_disable(struct src_mgr *mgr, struct src *src)522522{523523 struct hw *hw = mgr->mgr.hw;524524- int i = 0;524524+ int i;525525526526 src->rsc.ops->master(&src->rsc);527527 for (i = 0; i < src->rsc.msr; i++) {···545545546546int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr)547547{548548- int err = 0, i = 0;548548+ int err, i;549549 struct src_mgr *src_mgr;550550551551 *rsrc_mgr = NULL;···618618619619static int srcimp_map(struct srcimp *srcimp, struct src *src, struct rsc *input)620620{621621- struct imapper *entry = NULL;622622- int i = 0;621621+ struct imapper *entry;622622+ int i;623623624624 srcimp->rsc.ops->master(&srcimp->rsc);625625 src->rsc.ops->master(&src->rsc);···646646647647static int srcimp_unmap(struct srcimp *srcimp)648648{649649- int i = 0;649649+ int i;650650651651 /* Program master and conjugate resources */652652 for (i = 0; i < srcimp->rsc.msr; i++) {···669669 const struct srcimp_desc *desc,670670 struct srcimp_mgr *mgr)671671{672672- int err = 0;672672+ int err;673673674674 err = rsc_init(&srcimp->rsc, srcimp->idx[0],675675 SRCIMP, desc->msr, mgr->mgr.hw);···715715 const struct srcimp_desc *desc,716716 struct srcimp **rsrcimp)717717{718718- int err = 0, i = 0;719719- unsigned int idx = 0;720720- struct srcimp *srcimp = NULL;718718+ int err, i;719719+ unsigned int idx;720720+ struct srcimp *srcimp;721721 unsigned long flags;722722723723 *rsrcimp = NULL;···765765static int put_srcimp_rsc(struct srcimp_mgr *mgr, struct srcimp *srcimp)766766{767767 unsigned long flags;768768- int i = 0;768768+ int i;769769770770 spin_lock_irqsave(&mgr->mgr_lock, flags);771771 for (i = 0; i < srcimp->rsc.msr; i++)···795795static int srcimp_imap_add(struct srcimp_mgr *mgr, struct imapper *entry)796796{797797 unsigned long flags;798798- int err = 0;798798+ int err;799799800800 spin_lock_irqsave(&mgr->imap_lock, flags);801801 if ((0 == entry->addr) && (mgr->init_imap_added)) {···812812static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry)813813{814814 unsigned long flags;815815- int err = 0;815815+ int err;816816817817 spin_lock_irqsave(&mgr->imap_lock, flags);818818 err = input_mapper_delete(&mgr->imappers, entry, srcimp_map_op, mgr);···828828829829int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr)830830{831831- int err = 0;831831+ int err;832832 struct srcimp_mgr *srcimp_mgr;833833 struct imapper *entry;834834