All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, vkoul@kernel.org, broonie@kernel.org,
	srinivas.kandagatla@linaro.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 04/10] ASoC: qcom: q6afe: remove useless assignments
Date: Thu, 18 Feb 2021 16:29:10 -0600	[thread overview]
Message-ID: <20210218222916.89809-5-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20210218222916.89809-1-pierre-louis.bossart@linux.intel.com>

cppcheck warnings:

sound/soc/qcom/qdsp6/q6afe.c:848:25: note: Assignment 'p=NULL',
assigned value is 0
 struct q6afe_port *p = NULL;
                        ^
sound/soc/qcom/qdsp6/q6afe.c:854:7: note: Null pointer dereference
  if (p->token == token) {
      ^
sound/soc/qcom/qdsp6/q6afe.c:939:8: style: Redundant initialization
for 'wait'. The initialized value is overwritten before it is
read. [redundantInitialization]
  wait = &port->wait;
       ^
sound/soc/qcom/qdsp6/q6afe.c:933:26: note: wait is initialized
 wait_queue_head_t *wait = &port->wait;
                         ^
sound/soc/qcom/qdsp6/q6afe.c:939:8: note: wait is overwritten
  wait = &port->wait;
       ^
sound/soc/qcom/qdsp6/q6afe.c:1191:10: style: Redundant initialization
for 'port_id'. The initialized value is overwritten before it is
read. [redundantInitialization]
 port_id = port->id;
         ^
sound/soc/qcom/qdsp6/q6afe.c:1186:14: note: port_id is initialized
 int port_id = port->id;
             ^
sound/soc/qcom/qdsp6/q6afe.c:1191:10: note: port_id is overwritten
 port_id = port->id;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/qdsp6/q6afe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index daa58b5f941e..60061d654946 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -845,7 +845,7 @@ static void q6afe_port_free(struct kref *ref)
 
 static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
 {
-	struct q6afe_port *p = NULL;
+	struct q6afe_port *p;
 	struct q6afe_port *ret = NULL;
 	unsigned long flags;
 
@@ -930,7 +930,7 @@ EXPORT_SYMBOL_GPL(q6afe_get_port_id);
 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
 			    struct q6afe_port *port, uint32_t rsp_opcode)
 {
-	wait_queue_head_t *wait = &port->wait;
+	wait_queue_head_t *wait;
 	struct aprv2_ibasic_rsp_result_t *result;
 	int ret;
 
@@ -1188,7 +1188,6 @@ int q6afe_port_stop(struct q6afe_port *port)
 	int index, pkt_size;
 	void *p;
 
-	port_id = port->id;
 	index = port->token;
 	if (index < 0 || index >= AFE_PORT_MAX) {
 		dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
-- 
2.25.1


  parent reply	other threads:[~2021-02-18 22:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 02/10] ASoC: qcom: lpass-platform: remove useless assignment Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 03/10] ASoC: qcom: q6dsp-dai: clarify expression Pierre-Louis Bossart
2021-02-18 22:29 ` Pierre-Louis Bossart [this message]
2021-02-18 22:29 ` [PATCH 05/10] ASoC: qcom: q6afe: align function prototype Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 06/10] ASoC: qcom: q6asm: align function prototypes Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 07/10] ASoC: wcd-clsh-v2: " Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 08/10] ASoC: wcd9335: clarify return value Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 09/10] ASoC: wcd934x: remove useless return Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 10/10] ASoC: lpass-wsa-macro: add missing test Pierre-Louis Bossart
2021-02-19 10:32 ` [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Srinivas Kandagatla
2021-03-01 23:34 ` Mark Brown

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=20210218222916.89809-5-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    /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: link
Be 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.