public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Gross <andy.gross@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Anders Roxell <anders.roxell@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	mahesh sivasubramanian <msivasub@codeaurora.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings
Date: Mon, 25 Jun 2018 15:54:06 -0500	[thread overview]
Message-ID: <20180625205406.GC4689@hector.attlocal.net> (raw)
In-Reply-To: <CAK8P3a0y9pUC2PQFv-GABnsr7cWWAKuLoDNeC1tC2A8iByzmaw@mail.gmail.com>

On Mon, Jun 25, 2018 at 10:30:17PM +0200, Arnd Bergmann wrote:
> On Mon, Jun 25, 2018 at 7:05 PM, Andy Gross <andy.gross@linaro.org> 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);
> 
> Anything wrong with my fix that I posted a while ago?
> See https://lkml.org/lkml/2018/5/25/569

Not entirely, see the comment below.  I missed this one and the other fix
somehow.

> 
> I generally don't like patches that add incorrect initializations to
> work around warnings like this.

Correct me if I am wrong, but this just masks the warnings on toolchain/
platforms that exhibit these warnings.  I'm not entirely fond of doing
blanket init either to make the warnings go away either...


Andy

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-06-25 20:54 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
2018-06-25 20:30   ` Arnd Bergmann
2018-06-25 20:54     ` Andy Gross [this message]
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=20180625205406.GC4689@hector.attlocal.net \
    --to=andy.gross@linaro.org \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=msivasub@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=torvalds@linux-foundation.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