From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jyri Sarha Subject: Re: ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller Date: Thu, 11 Jun 2015 22:05:26 +0300 Message-ID: <5579DBF6.3030104@ti.com> References: <20150611150605.GB12192@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by alsa0.perex.cz (Postfix) with ESMTP id 3E5AC2665A9 for ; Thu, 11 Jun 2015 21:05:30 +0200 (CEST) In-Reply-To: <20150611150605.GB12192@mwanda> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Dan Carpenter Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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 >