diff mbox

sound: pci: hda: patch_analog: Remove some unused functions

Message ID 1420221508-32319-1-git-send-email-rickard_strandqvist@spectrumdigital.se (mailing list archive)
State New, archived
Headers show

Commit Message

Rickard Strandqvist Jan. 2, 2015, 5:58 p.m. UTC
Removes some functions that are not used anywhere:
ad198x_ch_mode_put() ad198x_ch_mode_info()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 sound/pci/hda/patch_analog.c |   21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Paul Bolle Jan. 2, 2015, 6:17 p.m. UTC | #1
On Fri, 2015-01-02 at 18:58 +0100, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> ad198x_ch_mode_put() ad198x_ch_mode_info()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---

You apparently overlooked _your_ commit 57da6bdd4823 ("ALSA: hda -
patch_analog.c: Remove some unused functions") in linux-next.

>  sound/pci/hda/patch_analog.c |   21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
> index 06275f8..ed0b71c 100644
> --- a/sound/pci/hda/patch_analog.c
> +++ b/sound/pci/hda/patch_analog.c
> @@ -698,15 +698,6 @@ static int patch_ad1981(struct hda_codec *codec)
>   */
>  
>  #ifdef ENABLE_AD_STATIC_QUIRKS
> -static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol,
> -			       struct snd_ctl_elem_info *uinfo)
> -{
> -	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> -	struct ad198x_spec *spec = codec->spec;
> -	return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
> -				    spec->num_channel_mode);
> -}
> -
>  static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
>  			      struct snd_ctl_elem_value *ucontrol)
>  {
> @@ -716,18 +707,6 @@ static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
>  				   spec->num_channel_mode, spec->multiout.max_channels);
>  }
>  
> -static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
> -			      struct snd_ctl_elem_value *ucontrol)
> -{
> -	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> -	struct ad198x_spec *spec = codec->spec;
> -	int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
> -				      spec->num_channel_mode,
> -				      &spec->multiout.max_channels);
> -	if (err >= 0 && spec->need_dac_fix)
> -		spec->multiout.num_dacs = spec->multiout.max_channels / 2;
> -	return err;
> -}
>  #endif /* ENABLE_AD_STATIC_QUIRKS */
>  
>  static int ad1988_auto_smux_enum_info(struct snd_kcontrol *kcontrol,

Thanks,


Paul Bolle
Rickard Strandqvist Jan. 3, 2015, 12:14 a.m. UTC | #2
2015-01-02 19:17 GMT+01:00 Paul Bolle <pebolle@tiscali.nl>:

> On Fri, 2015-01-02 at 18:58 +0100, Rickard Strandqvist wrote:
> > Removes some functions that are not used anywhere:
> > ad198x_ch_mode_put() ad198x_ch_mode_info()
> >
> > This was partially found by using a static code analysis program called
> cppcheck.
> >
> > Signed-off-by: Rickard Strandqvist <
> rickard_strandqvist@spectrumdigital.se>
> > ---
>
> You apparently overlooked _your_ commit 57da6bdd4823 ("ALSA: hda -
> patch_analog.c: Remove some unused functions") in linux-next.
>
> >  sound/pci/hda/patch_analog.c |   21 ---------------------
> >  1 file changed, 21 deletions(-)
> >
> > diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
> > index 06275f8..ed0b71c 100644
> > --- a/sound/pci/hda/patch_analog.c
> > +++ b/sound/pci/hda/patch_analog.c
> > @@ -698,15 +698,6 @@ static int patch_ad1981(struct hda_codec *codec)
> >   */
> >
> >  #ifdef ENABLE_AD_STATIC_QUIRKS
> > -static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol,
> > -                            struct snd_ctl_elem_info *uinfo)
> > -{
> > -     struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> > -     struct ad198x_spec *spec = codec->spec;
> > -     return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
> > -                                 spec->num_channel_mode);
> > -}
> > -
> >  static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
> >                             struct snd_ctl_elem_value *ucontrol)
> >  {
> > @@ -716,18 +707,6 @@ static int ad198x_ch_mode_get(struct snd_kcontrol
> *kcontrol,
> >                                  spec->num_channel_mode,
> spec->multiout.max_channels);
> >  }
> >
> > -static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
> > -                           struct snd_ctl_elem_value *ucontrol)
> > -{
> > -     struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> > -     struct ad198x_spec *spec = codec->spec;
> > -     int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
> > -                                   spec->num_channel_mode,
> > -                                   &spec->multiout.max_channels);
> > -     if (err >= 0 && spec->need_dac_fix)
> > -             spec->multiout.num_dacs = spec->multiout.max_channels / 2;
> > -     return err;
> > -}
> >  #endif /* ENABLE_AD_STATIC_QUIRKS */
> >
> >  static int ad1988_auto_smux_enum_info(struct snd_kcontrol *kcontrol,
>
> Thanks,
>
>
> Paul Bolle
>
>

Hi Paul

Sorry about that!

Have tried to change my script to avoid just that, so that all functions to
be removed in a file, with the same patch.

Everything was solved correctly in the commit 57da6bdd4823
So ignore this patch.



Kind regards
Rickard Strandqvist
diff mbox

Patch

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 06275f8..ed0b71c 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -698,15 +698,6 @@  static int patch_ad1981(struct hda_codec *codec)
  */
 
 #ifdef ENABLE_AD_STATIC_QUIRKS
-static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol,
-			       struct snd_ctl_elem_info *uinfo)
-{
-	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
-	struct ad198x_spec *spec = codec->spec;
-	return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
-				    spec->num_channel_mode);
-}
-
 static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
 			      struct snd_ctl_elem_value *ucontrol)
 {
@@ -716,18 +707,6 @@  static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
 				   spec->num_channel_mode, spec->multiout.max_channels);
 }
 
-static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
-			      struct snd_ctl_elem_value *ucontrol)
-{
-	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
-	struct ad198x_spec *spec = codec->spec;
-	int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
-				      spec->num_channel_mode,
-				      &spec->multiout.max_channels);
-	if (err >= 0 && spec->need_dac_fix)
-		spec->multiout.num_dacs = spec->multiout.max_channels / 2;
-	return err;
-}
 #endif /* ENABLE_AD_STATIC_QUIRKS */
 
 static int ad1988_auto_smux_enum_info(struct snd_kcontrol *kcontrol,