Skip to content

Commit

Permalink
ASoC: qcom: q6afe: remove useless assignments
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210218222916.89809-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Pierre-Louis Bossart authored and Mark Brown committed Mar 10, 2021
1 parent 18bcac6 commit 12900ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/qcom/qdsp6/q6afe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 12900ba

Please sign in to comment.