linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: qcom: Fix a uninitialized warning.
@ 2018-09-18  5:06 zhong jiang
  2018-09-18 17:17 ` Andy Gross
  0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2018-09-18  5:06 UTC (permalink / raw)
  To: andy.gross, david.brown; +Cc: linux-arm-msm, linux-soc, linux-kernel

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);

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/soc/qcom/cmd-db.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index a6f6462..280877f 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -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;
 
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: qcom: Fix a uninitialized warning.
  2018-09-18  5:06 [PATCH] ASoC: qcom: Fix a uninitialized warning zhong jiang
@ 2018-09-18 17:17 ` Andy Gross
  2018-09-19  1:52   ` zhong jiang
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Gross @ 2018-09-18 17:17 UTC (permalink / raw)
  To: zhong jiang; +Cc: david.brown, linux-arm-msm, linux-soc, linux-kernel

On Tue, Sep 18, 2018 at 01:06:48PM +0800, zhong jiang wrote:
> 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);
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: qcom: Fix a uninitialized warning.
  2018-09-18 17:17 ` Andy Gross
@ 2018-09-19  1:52   ` zhong jiang
  0 siblings, 0 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-19  1:52 UTC (permalink / raw)
  To: Andy Gross; +Cc: david.brown, linux-arm-msm, linux-soc, linux-kernel

On 2018/9/19 1:17, Andy Gross wrote:
> On Tue, Sep 18, 2018 at 01:06:48PM +0800, zhong jiang wrote:
>> 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);
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  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.
Thank you for your reply and review.  I will update the subject and repost.

Sincerely,
zhong jiang
>
> Regards,
>
> Andy
>
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-19  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18  5:06 [PATCH] ASoC: qcom: Fix a uninitialized warning zhong jiang
2018-09-18 17:17 ` Andy Gross
2018-09-19  1:52   ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).