Commit 9c0da293 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: remove cppcheck warnings for multiple SOCs" from...

Merge series "ASoC: remove cppcheck warnings for multiple SOCs" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Trivial cleanups to make cppcheck less verbose.

There should be no functionality change, except for the 'sti_uniperif'
patch where an error check was added.

Pierre-Louis Bossart (17):
  ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
  ASoC: atmel: fix shadowed variable
  ASoC: atmel: atmel-i2s: remove useless initialization
  ASoC: bcm: cygnus_ssp: remove useless initialization
  ASoC: meson: axg-tdmin: remove useless assignment
  ASoC: meson: axg-tdmout: remove useless assignment
  ASoC: pxa: remove useless assignment
  ASoC: sti: sti_uniperif: add missing error check
  ASoC: sti: uniperif: align function prototypes
  ASoC: stm: stm32_adfsdm: fix snprintf format string
  ASoC: sunxi: sun8i-codec: clarify expression
  ASoC: tegra: tegra20_das: clarify expression
  ASoC: tegra: tegra20_das: align function prototypes
  ASoC: ti: omap-abe-twl6040: remove useless assignment
  ASoC: ti: omap-mcsp: remove duplicate test
  ASoC: ux500: mop500: rename shadowing variable
  ASoC: ux500: mop500: align function prototype

 sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 --
 sound/soc/atmel/atmel-classd.c       | 6 +++---
 sound/soc/atmel/atmel-i2s.c          | 2 +-
 sound/soc/bcm/cygnus-ssp.c           | 2 +-
 sound/soc/meson/axg-tdmin.c          | 2 +-
 sound/soc/meson/axg-tdmout.c         | 2 +-
 sound/soc/pxa/mmp-pcm.c              | 2 +-
 sound/soc/sti/sti_uniperif.c         | 2 ++
 sound/soc/sti/uniperif.h             | 4 ++--
 sound/soc/stm/stm32_adfsdm.c         | 2 +-
 sound/soc/sunxi/sun8i-codec.c        | 2 +-
 sound/soc/tegra/tegra20_das.c        | 8 ++++----
 sound/soc/tegra/tegra20_das.h        | 6 +++---
 sound/soc/ti/omap-abe-twl6040.c      | 2 +-
 sound/soc/ti/omap-mcbsp.c            | 3 +--
 sound/soc/ux500/mop500.c             | 6 +++---
 sound/soc/ux500/mop500_ab8500.h      | 2 +-
 17 files changed, 27 insertions(+), 28 deletions(-)

--
2.25.1
parents bb0f78e5 b4d09a01
......@@ -129,7 +129,6 @@ static int start_pdm_dma(void __iomem *acp_base)
enable_pdm_clock(acp_base);
rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE);
rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE);
pdm_dma_enable = 0x00;
timeout = 0;
while (++timeout < ACP_COUNTER) {
pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE);
......@@ -153,7 +152,6 @@ static int stop_pdm_dma(void __iomem *acp_base)
if (pdm_dma_enable & 0x01) {
pdm_dma_enable = 0x02;
rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE);
pdm_dma_enable = 0x00;
timeout = 0;
while (++timeout < ACP_COUNTER) {
pdm_dma_enable = rn_readl(acp_base +
......
......@@ -48,7 +48,7 @@ static struct atmel_classd_pdata *atmel_classd_dt_init(struct device *dev)
{
struct device_node *np = dev->of_node;
struct atmel_classd_pdata *pdata;
const char *pwm_type;
const char *pwm_type_s;
int ret;
if (!np) {
......@@ -60,8 +60,8 @@ static struct atmel_classd_pdata *atmel_classd_dt_init(struct device *dev)
if (!pdata)
return ERR_PTR(-ENOMEM);
ret = of_property_read_string(np, "atmel,pwm-type", &pwm_type);
if ((ret == 0) && (strcmp(pwm_type, "diff") == 0))
ret = of_property_read_string(np, "atmel,pwm-type", &pwm_type_s);
if ((ret == 0) && (strcmp(pwm_type_s, "diff") == 0))
pdata->pwm_type = CLASSD_MR_PWMTYP_DIFF;
else
pdata->pwm_type = CLASSD_MR_PWMTYP_SINGLE;
......
......@@ -595,7 +595,7 @@ static int atmel_i2s_probe(struct platform_device *pdev)
struct regmap *regmap;
void __iomem *base;
int irq;
int err = -ENXIO;
int err;
unsigned int pcm_flags = 0;
unsigned int version;
......
......@@ -1310,7 +1310,7 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
struct device_node *child_node;
struct resource *res;
struct cygnus_audio *cygaud;
int err = -EINVAL;
int err;
int node_count;
int active_port_count;
......
......@@ -57,7 +57,7 @@ static const struct snd_kcontrol_new axg_tdmin_in_mux =
static struct snd_soc_dai *
axg_tdmin_get_be(struct snd_soc_dapm_widget *w)
{
struct snd_soc_dapm_path *p = NULL;
struct snd_soc_dapm_path *p;
struct snd_soc_dai *be;
snd_soc_dapm_widget_for_each_source_path(w, p) {
......
......@@ -55,7 +55,7 @@ static const struct regmap_config axg_tdmout_regmap_cfg = {
static struct snd_soc_dai *
axg_tdmout_get_be(struct snd_soc_dapm_widget *w)
{
struct snd_soc_dapm_path *p = NULL;
struct snd_soc_dapm_path *p;
struct snd_soc_dai *be;
snd_soc_dapm_widget_for_each_sink_path(w, p) {
......
......@@ -204,7 +204,7 @@ static int mmp_pcm_new(struct snd_soc_component *component,
{
struct snd_pcm_substream *substream;
struct snd_pcm *pcm = rtd->pcm;
int ret = 0, stream;
int ret, stream;
for (stream = 0; stream < 2; stream++) {
substream = pcm->streams[stream].substream;
......
......@@ -484,6 +484,8 @@ static int sti_uniperiph_probe(struct platform_device *pdev)
priv->pdev = pdev;
ret = sti_uniperiph_cpu_dai_of(node, priv);
if (ret < 0)
return ret;
dev_set_drvdata(&pdev->dev, priv);
......
......@@ -1372,12 +1372,12 @@ static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
/* uniperiph player*/
int uni_player_init(struct platform_device *pdev,
struct uniperif *uni_player);
struct uniperif *player);
int uni_player_resume(struct uniperif *player);
/* uniperiph reader */
int uni_reader_init(struct platform_device *pdev,
struct uniperif *uni_reader);
struct uniperif *reader);
/* common */
int sti_uniperiph_dai_set_fmt(struct snd_soc_dai *dai,
......
......@@ -117,7 +117,7 @@ static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,
/* Set IIO frequency if CODEC is master as clock comes from SPI_IN */
snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
snprintf(str_freq, sizeof(str_freq), "%u\n", freq);
size = iio_write_channel_ext_info(priv->iio_ch, "spi_clk_freq",
str_freq, sizeof(str_freq));
if (size != sizeof(str_freq)) {
......
......@@ -485,7 +485,7 @@ static int sun8i_codec_get_lrck_div_order(unsigned int slots,
static unsigned int sun8i_codec_get_sysclk_rate(unsigned int sample_rate)
{
return sample_rate % 4000 ? 22579200 : 24576000;
return (sample_rate % 4000) ? 22579200 : 24576000;
}
static int sun8i_codec_hw_params(struct snd_pcm_substream *substream,
......
......@@ -61,10 +61,10 @@ int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
addr = TEGRA20_DAS_DAP_CTRL_SEL +
(dap * TEGRA20_DAS_DAP_CTRL_SEL_STRIDE);
reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P |
!!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P |
!!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P |
!!master << TEGRA20_DAS_DAP_CTRL_SEL_DAP_MS_SEL_P;
reg = (otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P) |
(!!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P) |
(!!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P) |
(!!master << TEGRA20_DAS_DAP_CTRL_SEL_DAP_MS_SEL_P);
tegra20_das_write(addr, reg);
......
......@@ -95,7 +95,7 @@ struct tegra20_das {
* dap_id: DAP to connect: TEGRA20_DAS_DAP_ID_*
* dac_sel: DAC to connect to: TEGRA20_DAS_DAP_SEL_DAC*
*/
extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
extern int tegra20_das_connect_dap_to_dac(int dap, int dac);
/*
* Connect a DAP to another DAP
......@@ -105,7 +105,7 @@ extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
* sdata1rx: Is this DAP's SDATA1 pin RX (1) or TX (0)
* sdata2rx: Is this DAP's SDATA2 pin RX (1) or TX (0)
*/
extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
extern int tegra20_das_connect_dap_to_dap(int dap, int otherdap,
int master, int sdata1rx,
int sdata2rx);
......@@ -115,6 +115,6 @@ extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
* dac_id: DAC ID to connect: TEGRA20_DAS_DAC_ID_*
* dap_sel: DAP to receive input from: TEGRA20_DAS_DAC_SEL_DAP*
*/
extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
extern int tegra20_das_connect_dac_to_dap(int dac, int dap);
#endif
......@@ -170,7 +170,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_card *card = rtd->card;
struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
int hs_trim;
int ret = 0;
int ret;
/*
* Configure McPDM offset cancellation based on the HSOTRIM value from
......
......@@ -373,10 +373,9 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
/* Disable interrupt requests */
if (mcbsp->irq)
if (mcbsp->irq) {
MCBSP_WRITE(mcbsp, IRQEN, 0);
if (mcbsp->irq) {
free_irq(mcbsp->irq, (void *)mcbsp);
} else {
free_irq(mcbsp->rx_irq, (void *)mcbsp);
......
......@@ -140,12 +140,12 @@ static int mop500_probe(struct platform_device *pdev)
static int mop500_remove(struct platform_device *pdev)
{
struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
struct snd_soc_card *card = platform_get_drvdata(pdev);
pr_debug("%s: Enter.\n", __func__);
snd_soc_unregister_card(mop500_card);
mop500_ab8500_remove(mop500_card);
snd_soc_unregister_card(card);
mop500_ab8500_remove(card);
mop500_of_node_put();
return 0;
......
......@@ -13,7 +13,7 @@
extern struct snd_soc_ops mop500_ab8500_ops[];
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *runtime);
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd);
void mop500_ab8500_remove(struct snd_soc_card *card);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment