* Re: ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller
@ 2015-06-11 15:06 Dan Carpenter
2015-06-11 19:05 ` Jyri Sarha
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-06-11 15:06 UTC (permalink / raw)
To: jsarha; +Cc: alsa-devel
Hello Jyri Sarha,
The patch 9fbd58cf4ab0: "ASoC: davinci-mcasp: Choose PCM driver based
on configured DMA controller" from Jun 2, 2015, leads to the
following static checker warning:
sound/soc/davinci/davinci-mcasp.c:1842 davinci_mcasp_probe()
info: ignoring unreachable code.
sound/soc/davinci/davinci-mcasp.c
1812 switch (ret) {
1813 case PCM_EDMA:
1814 #if IS_BUILTIN(CONFIG_SND_EDMA_SOC) || \
1815 (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
1816 IS_MODULE(CONFIG_SND_EDMA_SOC))
1817 ret = edma_pcm_platform_register(&pdev->dev);
1818 #else
1819 dev_err(&pdev->dev, "Missing SND_EDMA_SOC\n");
1820 ret = -EINVAL;
1821 goto err;
1822 #endif
1823 break;
1824 case PCM_SDMA:
1825 #if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
1826 (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
1827 IS_MODULE(CONFIG_SND_OMAP_SOC))
1828 ret = omap_pcm_platform_register(&pdev->dev);
1829 #else
1830 dev_err(&pdev->dev, "Missing SND_SDMA_SOC\n");
1831 ret = -EINVAL;
1832 goto err;
1833 #endif
1834 break;
1835 default:
1836 dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
1837 case -EPROBE_DEFER:
1838 goto err;
1839 break;
1840 }
1841
Depending on the ifdefs then this is reachable, I guess...
1842 if (ret) {
1843 dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
1844 goto err;
1845 }
1846
1847 return 0;
1848
1849 err:
1850 pm_runtime_disable(&pdev->dev);
1851 return ret;
1852 }
1853
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller
2015-06-11 15:06 ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller Dan Carpenter
@ 2015-06-11 19:05 ` Jyri Sarha
0 siblings, 0 replies; 2+ messages in thread
From: Jyri Sarha @ 2015-06-11 19:05 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel
On 06/11/15 18:06, Dan Carpenter wrote:
> Hello Jyri Sarha,
>
> The patch 9fbd58cf4ab0: "ASoC: davinci-mcasp: Choose PCM driver based
> on configured DMA controller" from Jun 2, 2015, leads to the
> following static checker warning:
>
> sound/soc/davinci/davinci-mcasp.c:1842 davinci_mcasp_probe()
> info: ignoring unreachable code.
>
> sound/soc/davinci/davinci-mcasp.c
> 1812 switch (ret) {
> 1813 case PCM_EDMA:
> 1814 #if IS_BUILTIN(CONFIG_SND_EDMA_SOC) || \
> 1815 (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
> 1816 IS_MODULE(CONFIG_SND_EDMA_SOC))
> 1817 ret = edma_pcm_platform_register(&pdev->dev);
> 1818 #else
> 1819 dev_err(&pdev->dev, "Missing SND_EDMA_SOC\n");
> 1820 ret = -EINVAL;
> 1821 goto err;
> 1822 #endif
> 1823 break;
> 1824 case PCM_SDMA:
> 1825 #if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
> 1826 (IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
> 1827 IS_MODULE(CONFIG_SND_OMAP_SOC))
> 1828 ret = omap_pcm_platform_register(&pdev->dev);
> 1829 #else
> 1830 dev_err(&pdev->dev, "Missing SND_SDMA_SOC\n");
> 1831 ret = -EINVAL;
> 1832 goto err;
> 1833 #endif
> 1834 break;
> 1835 default:
> 1836 dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
> 1837 case -EPROBE_DEFER:
> 1838 goto err;
> 1839 break;
> 1840 }
> 1841
>
> Depending on the ifdefs then this is reachable, I guess...
Yes it is. I could remove the "goto err;" from #else branches to silence
the warning. That would cause a double error print for a single issue...
either way is Ok by me.
Best regards,
Jyri
>
> 1842 if (ret) {
> 1843 dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
> 1844 goto err;
> 1845 }
> 1846
> 1847 return 0;
> 1848
> 1849 err:
> 1850 pm_runtime_disable(&pdev->dev);
> 1851 return ret;
> 1852 }
> 1853
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-11 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 15:06 ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller Dan Carpenter
2015-06-11 19:05 ` Jyri Sarha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox