public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: andy.gross@linaro.org (Andy Gross)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings
Date: Mon, 25 Jun 2018 14:44:45 -0500	[thread overview]
Message-ID: <20180625194445.GB4689@hector.attlocal.net> (raw)
In-Reply-To: <1529946347-12740-2-git-send-email-andy.gross@linaro.org>

On Mon, Jun 25, 2018 at 12:05:47PM -0500, Andy Gross wrote:
> This patch adds initialization of the entry_header structs to avoid
> compiler warnings like the following:
> 
>   CC      drivers/soc/qcom/cmd-db.o
> drivers/soc/qcom/cmd-db.c: In function ?cmd_db_read_addr?:
> drivers/soc/qcom/cmd-db.c:194:21: 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: In function ?cmd_db_read_aux_data_len?:
> 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: In function ?cmd_db_read_slave_id?:
> drivers/soc/qcom/cmd-db.c:269:7: warning: ?ent.addr? may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>   addr = le32_to_cpu(ent.addr);
> 
> drivers/soc/qcom/cmd-db.c: In function ?cmd_db_read_aux_data?:
> drivers/soc/qcom/cmd-db.c:221:10: warning: ?ent.len? may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>   ent_len = le16_to_cpu(ent.len);
> 
> drivers/soc/qcom/cmd-db.c:226:15: warning: ?*((void *)&rsc_hdr+4)? may
> be used uninitialized in this function [-Wmaybe-uninitialized]
>   memcpy(data, rsc_offset(&rsc_hdr, &ent), len);
>                ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/soc/qcom/cmd-db.c:226:15: warning: ?*((void *)&ent+22)? may be
> used uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Andy Gross <andy.gross@linaro.org>

I flubbed this one due to missing an already existing patch that fixes
the warnings.  I'm going to package that one up with the errno check
patch and send a fixes pull request.

precursor patch:
https://patchwork.kernel.org/patch/10384143/


Andy

  reply	other threads:[~2018-06-25 19:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 17:05 [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Andy Gross
2018-06-25 17:05 ` [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings Andy Gross
2018-06-25 19:44   ` Andy Gross [this message]
2018-06-25 20:30   ` Arnd Bergmann
2018-06-25 20:54     ` Andy Gross
2018-06-25 21:08       ` Arnd Bergmann
2018-06-25 23:26         ` Bjorn Andersson
2018-06-25 19:14 ` [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Bjorn Andersson

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=20180625194445.GB4689@hector.attlocal.net \
    --to=andy.gross@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox