ASoC: qcom: Fix a uninitialized warning.
Subsystems (2)
PATCH 1/1 ASoC: qcom: Fix a uninitialized warning.
Fix the following compile warning:
drivers/soc/qcom/cmd-db.c:194:38: warning: ent.addr may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 : le32_to_cpu(ent.addr);
drivers/soc/qcom/cmd-db.c:247:38: warning: ent.len may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 : le16_to_cpu(ent.len);
drivers/soc/qcom/cmd-db.c:269:24: warning: ent.addr may be used uninitialized in this function [-Wmaybe-uninitialized]
addr = le32_to_cpu(ent.addr);
--- drivers/soc/qcom/cmd-db.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/soc/qcom/cmd-db.c +3 -3
@@ -186,7 +186,7 @@ static int cmd_db_get_header(const char *id, struct entry_header *eh,u32 cmd_db_read_addr (const char *id) {int ret; -struct entry_header ent; +struct entry_header ent = {0 };struct rsc_hdr rsc_hdr; ret =cmd_db_get_header (id, &ent, &rsc_hdr);
@@ -239,7 +239,7 @@ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len)size_t cmd_db_read_aux_data_len (const char *id) {int ret; -struct entry_header ent; +struct entry_header ent = {0 };struct rsc_hdr rsc_hdr; ret =cmd_db_get_header (id, &ent, &rsc_hdr);
@@ -258,7 +258,7 @@ size_t cmd_db_read_aux_data_len(const char *id)enum cmd_db_hw_type cmd_db_read_slave_id (const char *id) {int ret; -struct entry_header ent; +struct entry_header ent = {0 };struct rsc_hdr rsc_hdr;u32 addr;
Signature · 1 line
1.7.12.4
Quoted 8 lines · zhong jiang
Fix the following compile warning:
drivers/soc/qcom/cmd-db.c:194:38: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 :le32_to_cpu(ent.addr);
drivers/soc/qcom/cmd-db.c:247:38: warning: ‘ent.len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 :le16_to_cpu(ent.len);
Quoted 7 lines
drivers/soc/qcom/cmd-db.c:269:24: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
addr =le32_to_cpu(ent.addr);Signed-off-by zhong jiang <[email protected]>--- drivers/soc/qcom/cmd-db.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
This is kind of an odd subject for the patch. It should be something like
drivers: qcom: cmd-db: XXXXXXXXXXXXX
ASOC is sound related.
Regards,
Andy
Quoted 12 lines · Andy Gross
Quoted 11 lines · zhong jiang
Fix the following compile warning:
drivers/soc/qcom/cmd-db.c:194:38: warning: 'ent.addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 :le32_to_cpu(ent.addr);
drivers/soc/qcom/cmd-db.c:247:38: warning: 'ent.len' may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret < 0 ? 0 :le16_to_cpu(ent.len);
drivers/soc/qcom/cmd-db.c:269:24: warning: 'ent.addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
addr =le32_to_cpu(ent.addr);
Quoted 8 lines
Quoted 4 lines
Signed-off-by zhong jiang <[email protected]>--- drivers/soc/qcom/cmd-db.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)This is kind of an odd subject for the patch. It should be something like
drivers: qcom: cmd-db: XXXXXXXXXXXXXASOC is sound related.
Thank you for your reply and review. I will update the subject and repost.
Sincerely,
zhong jiang
Quoted 6 lines
Regards,
Andy