Commit 88406aa6 authored by Mark Brown's avatar Mark Brown

ASoC: trivial changes for cppcheck warnings

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This can probably wait for the next merge window, I found a number of
cppcheck warnings that I didn't see in my last checks. The irony is
that the only really important issue found by cppcheck was on one of
my previous DPCM changes (submitted separately as a fix).
parents ed05d691 7188b28f
...@@ -209,7 +209,7 @@ struct cs35l45_private { ...@@ -209,7 +209,7 @@ struct cs35l45_private {
extern const struct dev_pm_ops cs35l45_pm_ops; extern const struct dev_pm_ops cs35l45_pm_ops;
extern const struct regmap_config cs35l45_i2c_regmap; extern const struct regmap_config cs35l45_i2c_regmap;
extern const struct regmap_config cs35l45_spi_regmap; extern const struct regmap_config cs35l45_spi_regmap;
int cs35l45_apply_patch(struct cs35l45_private *cs43l45); int cs35l45_apply_patch(struct cs35l45_private *cs35l45);
unsigned int cs35l45_get_clk_freq_id(unsigned int freq); unsigned int cs35l45_get_clk_freq_id(unsigned int freq);
int cs35l45_probe(struct cs35l45_private *cs35l45); int cs35l45_probe(struct cs35l45_private *cs35l45);
void cs35l45_remove(struct cs35l45_private *cs35l45); void cs35l45_remove(struct cs35l45_private *cs35l45);
......
...@@ -1701,8 +1701,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data) ...@@ -1701,8 +1701,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data)
break; break;
default: default:
if (cs42l42->plug_state != CS42L42_TS_TRANS) cs42l42->plug_state = CS42L42_TS_TRANS;
cs42l42->plug_state = CS42L42_TS_TRANS;
} }
} }
......
...@@ -1306,7 +1306,7 @@ static irqreturn_t wcd_mbhc_adc_hs_rem_irq(int irq, void *data) ...@@ -1306,7 +1306,7 @@ static irqreturn_t wcd_mbhc_adc_hs_rem_irq(int irq, void *data)
static irqreturn_t wcd_mbhc_adc_hs_ins_irq(int irq, void *data) static irqreturn_t wcd_mbhc_adc_hs_ins_irq(int irq, void *data)
{ {
struct wcd_mbhc *mbhc = data; struct wcd_mbhc *mbhc = data;
u8 clamp_state = 0; u8 clamp_state;
u8 clamp_retry = WCD_MBHC_FAKE_INS_RETRY; u8 clamp_retry = WCD_MBHC_FAKE_INS_RETRY;
/* /*
......
...@@ -1807,11 +1807,11 @@ static int wcd9335_set_decimator_rate(struct snd_soc_dai *dai, ...@@ -1807,11 +1807,11 @@ static int wcd9335_set_decimator_rate(struct snd_soc_dai *dai,
tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG0; tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG0;
shift = (tx_port << 1); shift = (tx_port << 1);
shift_val = 0x03; shift_val = 0x03;
} else if ((tx_port >= 4) && (tx_port < 8)) { } else if (tx_port < 8) {
tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG1; tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG1;
shift = ((tx_port - 4) << 1); shift = ((tx_port - 4) << 1);
shift_val = 0x03; shift_val = 0x03;
} else if ((tx_port >= 8) && (tx_port < 11)) { } else if (tx_port < 11) {
tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG2; tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG2;
shift = ((tx_port - 8) << 1); shift = ((tx_port - 8) << 1);
shift_val = 0x03; shift_val = 0x03;
......
...@@ -1328,7 +1328,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) ...@@ -1328,7 +1328,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
{ {
struct sst_data *drv = snd_soc_dai_get_drvdata(dai); struct sst_data *drv = snd_soc_dai_get_drvdata(dai);
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
struct snd_soc_dapm_path *p = NULL; struct snd_soc_dapm_path *p;
dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream); dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream);
...@@ -1392,7 +1392,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) ...@@ -1392,7 +1392,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
static int sst_fill_module_list(struct snd_kcontrol *kctl, static int sst_fill_module_list(struct snd_kcontrol *kctl,
struct snd_soc_dapm_widget *w, int type) struct snd_soc_dapm_widget *w, int type)
{ {
struct sst_module *module = NULL; struct sst_module *module;
struct snd_soc_component *c = snd_soc_dapm_to_component(w->dapm); struct snd_soc_component *c = snd_soc_dapm_to_component(w->dapm);
struct sst_ids *ids = w->priv; struct sst_ids *ids = w->priv;
int ret = 0; int ret = 0;
......
...@@ -114,7 +114,7 @@ static irqreturn_t intel_sst_interrupt_mrfld(int irq, void *context) ...@@ -114,7 +114,7 @@ static irqreturn_t intel_sst_interrupt_mrfld(int irq, void *context)
static irqreturn_t intel_sst_irq_thread_mrfld(int irq, void *context) static irqreturn_t intel_sst_irq_thread_mrfld(int irq, void *context)
{ {
struct intel_sst_drv *drv = (struct intel_sst_drv *) context; struct intel_sst_drv *drv = (struct intel_sst_drv *) context;
struct ipc_post *__msg, *msg = NULL; struct ipc_post *__msg, *msg;
unsigned long irq_flags; unsigned long irq_flags;
spin_lock_irqsave(&drv->rx_msg_lock, irq_flags); spin_lock_irqsave(&drv->rx_msg_lock, irq_flags);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
struct sst_block *sst_create_block(struct intel_sst_drv *ctx, struct sst_block *sst_create_block(struct intel_sst_drv *ctx,
u32 msg_id, u32 drv_id) u32 msg_id, u32 drv_id)
{ {
struct sst_block *msg = NULL; struct sst_block *msg;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
msg = kzalloc(sizeof(*msg), GFP_KERNEL); msg = kzalloc(sizeof(*msg), GFP_KERNEL);
...@@ -63,7 +63,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx, ...@@ -63,7 +63,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx,
int sst_wake_up_block(struct intel_sst_drv *ctx, int result, int sst_wake_up_block(struct intel_sst_drv *ctx, int result,
u32 drv_id, u32 ipc, void *data, u32 size) u32 drv_id, u32 ipc, void *data, u32 size)
{ {
struct sst_block *block = NULL; struct sst_block *block;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
...@@ -91,7 +91,7 @@ int sst_wake_up_block(struct intel_sst_drv *ctx, int result, ...@@ -91,7 +91,7 @@ int sst_wake_up_block(struct intel_sst_drv *ctx, int result,
int sst_free_block(struct intel_sst_drv *ctx, struct sst_block *freed) int sst_free_block(struct intel_sst_drv *ctx, struct sst_block *freed)
{ {
struct sst_block *block = NULL, *__block; struct sst_block *block, *__block;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
spin_lock_bh(&ctx->block_lock); spin_lock_bh(&ctx->block_lock);
...@@ -341,7 +341,7 @@ void sst_process_reply_mrfld(struct intel_sst_drv *sst_drv_ctx, ...@@ -341,7 +341,7 @@ void sst_process_reply_mrfld(struct intel_sst_drv *sst_drv_ctx,
} }
/* FW sent short error response for an IPC */ /* FW sent short error response for an IPC */
if (msg_high.part.result && drv_id && !msg_high.part.large) { if (msg_high.part.result && !msg_high.part.large) {
/* 32-bit FW error code in msg_low */ /* 32-bit FW error code in msg_low */
dev_err(sst_drv_ctx->dev, "FW sent error response 0x%x", msg_low); dev_err(sst_drv_ctx->dev, "FW sent error response 0x%x", msg_low);
sst_wake_up_block(sst_drv_ctx, msg_high.part.result, sst_wake_up_block(sst_drv_ctx, msg_high.part.result,
......
...@@ -1636,7 +1636,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) ...@@ -1636,7 +1636,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
* with the codec driver/pdata are non-existent * with the codec driver/pdata are non-existent
*/ */
struct acpi_chan_package chan_package; struct acpi_chan_package chan_package = { 0 };
/* format specified: 2 64-bit integers */ /* format specified: 2 64-bit integers */
struct acpi_buffer format = {sizeof("NN"), "NN"}; struct acpi_buffer format = {sizeof("NN"), "NN"};
......
...@@ -952,7 +952,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) ...@@ -952,7 +952,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
* with the codec driver/pdata are non-existent * with the codec driver/pdata are non-existent
*/ */
struct acpi_chan_package chan_package; struct acpi_chan_package chan_package = { 0 };
/* format specified: 2 64-bit integers */ /* format specified: 2 64-bit integers */
struct acpi_buffer format = {sizeof("NN"), "NN"}; struct acpi_buffer format = {sizeof("NN"), "NN"};
......
...@@ -603,7 +603,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -603,7 +603,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
* with the codec driver/pdata are non-existent * with the codec driver/pdata are non-existent
*/ */
struct acpi_chan_package chan_package; struct acpi_chan_package chan_package = { 0 };
/* format specified: 2 64-bit integers */ /* format specified: 2 64-bit integers */
struct acpi_buffer format = {sizeof("NN"), "NN"}; struct acpi_buffer format = {sizeof("NN"), "NN"};
......
...@@ -419,7 +419,7 @@ static int sof_audio_probe(struct platform_device *pdev) ...@@ -419,7 +419,7 @@ static int sof_audio_probe(struct platform_device *pdev)
static int sof_pcm512x_remove(struct platform_device *pdev) static int sof_pcm512x_remove(struct platform_device *pdev)
{ {
struct snd_soc_card *card = platform_get_drvdata(pdev); struct snd_soc_card *card = platform_get_drvdata(pdev);
struct snd_soc_component *component = NULL; struct snd_soc_component *component;
for_each_card_components(card, component) { for_each_card_components(card, component) {
if (!strcmp(component->name, pcm512x_component[0].name)) { if (!strcmp(component->name, pcm512x_component[0].name)) {
......
...@@ -284,7 +284,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe, ...@@ -284,7 +284,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
{ {
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
unsigned long flags; unsigned long flags;
int ret = 0; int ret;
if (!cfg) if (!cfg)
return -EINVAL; return -EINVAL;
...@@ -308,7 +308,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe, ...@@ -308,7 +308,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
spin_unlock_irqrestore(&cfg->ctrl_lock, flags); spin_unlock_irqrestore(&cfg->ctrl_lock, flags);
return ret; return 0;
} }
static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
...@@ -316,7 +316,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, ...@@ -316,7 +316,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
{ {
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
unsigned long flags; unsigned long flags;
int ret = 0; int ret;
if (!cfg) if (!cfg)
return -EINVAL; return -EINVAL;
...@@ -338,7 +338,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, ...@@ -338,7 +338,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
if (ret) if (ret)
return ret; return ret;
return ret; return 0;
} }
int mt8195_afe_get_mclk_source_clk_id(int sel) int mt8195_afe_get_mclk_source_clk_id(int sel)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
static struct snd_soc_dapm_widget * static struct snd_soc_dapm_widget *
meson_codec_glue_get_input(struct snd_soc_dapm_widget *w) meson_codec_glue_get_input(struct snd_soc_dapm_widget *w)
{ {
struct snd_soc_dapm_path *p = NULL; struct snd_soc_dapm_path *p;
struct snd_soc_dapm_widget *in; struct snd_soc_dapm_widget *in;
snd_soc_dapm_widget_for_each_source_path(w, p) { snd_soc_dapm_widget_for_each_source_path(w, p) {
......
...@@ -90,7 +90,7 @@ struct q6adm_session_map_node_v5 { ...@@ -90,7 +90,7 @@ struct q6adm_session_map_node_v5 {
static struct q6copp *q6adm_find_copp(struct q6adm *adm, int port_idx, static struct q6copp *q6adm_find_copp(struct q6adm *adm, int port_idx,
int copp_idx) int copp_idx)
{ {
struct q6copp *c = NULL; struct q6copp *c;
struct q6copp *ret = NULL; struct q6copp *ret = NULL;
unsigned long flags; unsigned long flags;
...@@ -180,7 +180,7 @@ static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data) ...@@ -180,7 +180,7 @@ static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data)
u32 status; u32 status;
u16 copp_id; u16 copp_id;
u16 reserved; u16 reserved;
} __packed * open = data->payload; } __packed *open = data->payload;
copp = q6adm_find_copp(adm, port_idx, copp_idx); copp = q6adm_find_copp(adm, port_idx, copp_idx);
if (!copp) if (!copp)
...@@ -299,7 +299,7 @@ static struct q6copp *q6adm_find_matching_copp(struct q6adm *adm, ...@@ -299,7 +299,7 @@ static struct q6copp *q6adm_find_matching_copp(struct q6adm *adm,
int channel_mode, int bit_width, int channel_mode, int bit_width,
int app_type) int app_type)
{ {
struct q6copp *c = NULL; struct q6copp *c;
struct q6copp *ret = NULL; struct q6copp *ret = NULL;
unsigned long flags; unsigned long flags;
......
...@@ -169,7 +169,7 @@ static struct snd_soc_card snd_soc_card_rk = { ...@@ -169,7 +169,7 @@ static struct snd_soc_card snd_soc_card_rk = {
static int snd_rk_mc_probe(struct platform_device *pdev) static int snd_rk_mc_probe(struct platform_device *pdev)
{ {
int ret = 0; int ret;
struct snd_soc_card *card = &snd_soc_card_rk; struct snd_soc_card *card = &snd_soc_card_rk;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct rk_drvdata *machine; struct rk_drvdata *machine;
...@@ -253,7 +253,7 @@ static int snd_rk_mc_probe(struct platform_device *pdev) ...@@ -253,7 +253,7 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, ret, return dev_err_probe(&pdev->dev, ret,
"Soc register card failed\n"); "Soc register card failed\n");
return ret; return 0;
} }
static const struct of_device_id rockchip_sound_of_match[] = { static const struct of_device_id rockchip_sound_of_match[] = {
......
...@@ -216,7 +216,7 @@ static int snow_probe(struct platform_device *pdev) ...@@ -216,7 +216,7 @@ static int snow_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, ret, return dev_err_probe(&pdev->dev, ret,
"snd_soc_register_card failed\n"); "snd_soc_register_card failed\n");
return ret; return 0;
} }
static int snow_remove(struct platform_device *pdev) static int snow_remove(struct platform_device *pdev)
......
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