* [PATCH] sound: pci: hda: patch_analog.c: Remove unused function
@ 2014-12-20 22:31 Rickard Strandqvist
[not found] ` <CAN8cciaCGXHJaxQfkgvwCehwAcZvH_m6QaSTv_aUgSd1Y4x+og@mail.gmail.com>
2014-12-25 10:16 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 22:31 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: Rickard Strandqvist, alsa-devel, linux-kernel
Remove the function ad198x_ch_mode_get() that is not used anywhere.
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 | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 06275f8..9d5257b 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -707,15 +707,6 @@ static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol,
spec->num_channel_mode);
}
-static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- struct ad198x_spec *spec = codec->spec;
- return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode,
- spec->num_channel_mode, spec->multiout.max_channels);
-}
-
static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
--
1.7.10.4
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <CAN8cciaCGXHJaxQfkgvwCehwAcZvH_m6QaSTv_aUgSd1Y4x+og@mail.gmail.com>]
* Re: [alsa-devel] [PATCH] sound: pci: hda: patch_analog.c: Remove unused function [not found] ` <CAN8cciaCGXHJaxQfkgvwCehwAcZvH_m6QaSTv_aUgSd1Y4x+og@mail.gmail.com> @ 2014-12-21 11:40 ` Rickard Strandqvist 0 siblings, 0 replies; 3+ messages in thread From: Rickard Strandqvist @ 2014-12-21 11:40 UTC (permalink / raw) To: Raymond Yau; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel 2014-12-21 9:00 GMT+01:00 Raymond Yau <superquad.vortex2@gmail.com>: >> >> Remove the function ad198x_ch_mode_get() that is not used anywhere. >> >> 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 | 9 --------- >> 1 file changed, 9 deletions(-) >> >> diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c >> index 06275f8..9d5257b 100644 >> --- a/sound/pci/hda/patch_analog.c >> +++ b/sound/pci/hda/patch_analog.c >> @@ -707,15 +707,6 @@ static int ad198x_ch_mode_info(struct snd_kcontrol >> *kcontrol, >> spec->num_channel_mode); >> } >> >> -static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol, >> - struct snd_ctl_elem_value *ucontrol) >> -{ >> - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); >> - struct ad198x_spec *spec = codec->spec; >> - return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode, >> - spec->num_channel_mode, >> spec->multiout.max_channels); >> -} >> - >> static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, >> struct snd_ctl_elem_value *ucontrol) >> { >> -- > > Seem all three functions can be removed instead of one > > 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) > { > struct hda_codec *codec = snd_kcontrol_chip(kcontrol); > struct ad198x_spec *spec = codec->spec; > return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode, > 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 */ > Hi Yes, that's right :) The other was included in my list of function that could possibly deleted after a build test. I do it now, and will submit a new patch. Kind regards Rickard Strandqvist ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sound: pci: hda: patch_analog.c: Remove unused function 2014-12-20 22:31 [PATCH] sound: pci: hda: patch_analog.c: Remove unused function Rickard Strandqvist [not found] ` <CAN8cciaCGXHJaxQfkgvwCehwAcZvH_m6QaSTv_aUgSd1Y4x+og@mail.gmail.com> @ 2014-12-25 10:16 ` Takashi Iwai 1 sibling, 0 replies; 3+ messages in thread From: Takashi Iwai @ 2014-12-25 10:16 UTC (permalink / raw) To: Rickard Strandqvist; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel At Sat, 20 Dec 2014 23:31:19 +0100, Rickard Strandqvist wrote: > > Remove the function ad198x_ch_mode_get() that is not used anywhere. > > This was partially found by using a static code analysis program called cppcheck. > > Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> As Raymond suggested, remove the whole dead #ifdef block instead. It's a left-over code I forgot to remove. thanks, Takashi > --- > sound/pci/hda/patch_analog.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c > index 06275f8..9d5257b 100644 > --- a/sound/pci/hda/patch_analog.c > +++ b/sound/pci/hda/patch_analog.c > @@ -707,15 +707,6 @@ static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol, > spec->num_channel_mode); > } > > -static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol, > - struct snd_ctl_elem_value *ucontrol) > -{ > - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); > - struct ad198x_spec *spec = codec->spec; > - return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode, > - spec->num_channel_mode, spec->multiout.max_channels); > -} > - > static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, > struct snd_ctl_elem_value *ucontrol) > { > -- > 1.7.10.4 > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-25 10:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-20 22:31 [PATCH] sound: pci: hda: patch_analog.c: Remove unused function Rickard Strandqvist
[not found] ` <CAN8cciaCGXHJaxQfkgvwCehwAcZvH_m6QaSTv_aUgSd1Y4x+og@mail.gmail.com>
2014-12-21 11:40 ` [alsa-devel] " Rickard Strandqvist
2014-12-25 10:16 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®