X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sound%2Fusb%2Fusbmixer.c;h=c3c08c9cb46edfceca5b018f9f5efe7897201aa0;hb=556902cd2d2cfdc54fe1f1d7f3ac5e2eb276ac09;hp=83ba665e5c6e73d71af5886c8a8ff66ff6d48f9e;hpb=aafad5629a949d0ad41180f8a746b6cd7654e317;p=~andy%2Flinux diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 83ba665e5c6..c3c08c9cb46 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c @@ -363,7 +363,7 @@ static int get_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int *value } /* channel = 0: master, 1 = first channel */ -inline static int get_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int *value) +static inline int get_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int *value) { return get_ctl_value(cval, GET_CUR, (cval->control << 8) | channel, value); } @@ -399,7 +399,7 @@ static int set_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int value) return set_ctl_value(cval, SET_CUR, validx, value); } -inline static int set_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int value) +static inline int set_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int value) { return set_ctl_value(cval, SET_CUR, (cval->control << 8) | channel, value); } @@ -623,10 +623,8 @@ static struct usb_feature_control_info audio_feature_info[] = { /* private_free callback */ static void usb_mixer_elem_free(snd_kcontrol_t *kctl) { - if (kctl->private_data) { - kfree(kctl->private_data); - kctl->private_data = NULL; - } + kfree(kctl->private_data); + kctl->private_data = NULL; } @@ -826,7 +824,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc, if (check_ignored_ctl(state, unitid, control)) return; - cval = kcalloc(1, sizeof(*cval), GFP_KERNEL); + cval = kzalloc(sizeof(*cval), GFP_KERNEL); if (! cval) { snd_printk(KERN_ERR "cannot malloc kcontrol\n"); return; @@ -999,7 +997,7 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc, if (check_ignored_ctl(state, unitid, 0)) return; - cval = kcalloc(1, sizeof(*cval), GFP_KERNEL); + cval = kzalloc(sizeof(*cval), GFP_KERNEL); if (! cval) return; @@ -1246,7 +1244,7 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char continue; if (check_ignored_ctl(state, unitid, valinfo->control)) continue; - cval = kcalloc(1, sizeof(*cval), GFP_KERNEL); + cval = kzalloc(sizeof(*cval), GFP_KERNEL); if (! cval) { snd_printk(KERN_ERR "cannot malloc kcontrol\n"); return -ENOMEM; @@ -1432,7 +1430,7 @@ static int parse_audio_selector_unit(mixer_build_t *state, int unitid, unsigned if (check_ignored_ctl(state, unitid, 0)) return 0; - cval = kcalloc(1, sizeof(*cval), GFP_KERNEL); + cval = kzalloc(sizeof(*cval), GFP_KERNEL); if (! cval) { snd_printk(KERN_ERR "cannot malloc kcontrol\n"); return -ENOMEM; @@ -1947,7 +1945,7 @@ int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif) strcpy(chip->card->mixername, "USB Mixer"); - mixer = kcalloc(1, sizeof(*mixer), GFP_KERNEL); + mixer = kzalloc(sizeof(*mixer), GFP_KERNEL); if (!mixer) return -ENOMEM; mixer->chip = chip;