From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de> Cc: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>, Benoit Taine <benoit.taine@lip6.fr>, Bjorn Helgaas <bhelgaas@google.com>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] sound: pci: cmipci.c: Cleaning up function that are not used anywhere Date: Wed, 3 Dec 2014 00:12:55 +0100 [thread overview] Message-ID: <1417561975-27627-1-git-send-email-rickard_strandqvist@spectrumdigital.se> (raw) Remove function snd_cmipci_pll_rmn() 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/cmipci.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 85ed403..e33edae 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -615,47 +615,6 @@ static unsigned int snd_cmipci_rate_freq(unsigned int rate) #ifdef USE_VAR48KRATE /* - * Determine PLL values for frequency setup, maybe the CMI8338 (CMI8738???) - * does it this way .. maybe not. Never get any information from C-Media about - * that <werner@suse.de>. - */ -static int snd_cmipci_pll_rmn(unsigned int rate, unsigned int adcmult, int *r, int *m, int *n) -{ - unsigned int delta, tolerance; - int xm, xn, xr; - - for (*r = 0; rate < CM_MAXIMUM_RATE/adcmult; *r += (1<<5)) - rate <<= 1; - *n = -1; - if (*r > 0xff) - goto out; - tolerance = rate*CM_TOLERANCE_RATE; - - for (xn = (1+2); xn < (0x1f+2); xn++) { - for (xm = (1+2); xm < (0xff+2); xm++) { - xr = ((CM_REFFREQ_XIN/adcmult) * xm) / xn; - - if (xr < rate) - delta = rate - xr; - else - delta = xr - rate; - - /* - * If we found one, remember this, - * and try to find a closer one - */ - if (delta < tolerance) { - tolerance = delta; - *m = xm - 2; - *n = xn - 2; - } - } - } -out: - return (*n > -1); -} - -/* * Program pll register bits, I assume that the 8 registers 0xf8 up to 0xff * are mapped onto the 8 ADC/DAC sampling frequency which can be chosen * at the register CM_REG_FUNCTRL1 (0x04). -- 1.7.10.4
WARNING: multiple messages have this Message-ID (diff)
From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de> Cc: Bjorn Helgaas <bhelgaas@google.com>, Benoit Taine <benoit.taine@lip6.fr>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Subject: [PATCH] sound: pci: cmipci.c: Cleaning up function that are not used anywhere Date: Wed, 3 Dec 2014 00:12:55 +0100 [thread overview] Message-ID: <1417561975-27627-1-git-send-email-rickard_strandqvist@spectrumdigital.se> (raw) Remove function snd_cmipci_pll_rmn() 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/cmipci.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 85ed403..e33edae 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -615,47 +615,6 @@ static unsigned int snd_cmipci_rate_freq(unsigned int rate) #ifdef USE_VAR48KRATE /* - * Determine PLL values for frequency setup, maybe the CMI8338 (CMI8738???) - * does it this way .. maybe not. Never get any information from C-Media about - * that <werner@suse.de>. - */ -static int snd_cmipci_pll_rmn(unsigned int rate, unsigned int adcmult, int *r, int *m, int *n) -{ - unsigned int delta, tolerance; - int xm, xn, xr; - - for (*r = 0; rate < CM_MAXIMUM_RATE/adcmult; *r += (1<<5)) - rate <<= 1; - *n = -1; - if (*r > 0xff) - goto out; - tolerance = rate*CM_TOLERANCE_RATE; - - for (xn = (1+2); xn < (0x1f+2); xn++) { - for (xm = (1+2); xm < (0xff+2); xm++) { - xr = ((CM_REFFREQ_XIN/adcmult) * xm) / xn; - - if (xr < rate) - delta = rate - xr; - else - delta = xr - rate; - - /* - * If we found one, remember this, - * and try to find a closer one - */ - if (delta < tolerance) { - tolerance = delta; - *m = xm - 2; - *n = xn - 2; - } - } - } -out: - return (*n > -1); -} - -/* * Program pll register bits, I assume that the 8 registers 0xf8 up to 0xff * are mapped onto the 8 ADC/DAC sampling frequency which can be chosen * at the register CM_REG_FUNCTRL1 (0x04). -- 1.7.10.4
next reply other threads:[~2014-12-02 23:10 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-02 23:12 Rickard Strandqvist [this message] 2014-12-02 23:12 ` [PATCH] sound: pci: cmipci.c: Cleaning up function that are not used anywhere Rickard Strandqvist 2014-12-02 23:51 ` Bjorn Helgaas 2014-12-03 6:55 ` Takashi Iwai 2014-12-03 17:17 ` Rickard Strandqvist 2014-12-03 17:24 ` Takashi Iwai
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1417561975-27627-1-git-send-email-rickard_strandqvist@spectrumdigital.se \ --to=rickard_strandqvist@spectrumdigital.se \ --cc=alsa-devel@alsa-project.org \ --cc=benoit.taine@lip6.fr \ --cc=bhelgaas@google.com \ --cc=linux-kernel@vger.kernel.org \ --cc=perex@perex.cz \ --cc=tiwai@suse.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.