linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: ktd2692: avoid harmless maybe-uninitialized warning
Date: Wed, 25 Jan 2017 23:36:27 +0100	[thread overview]
Message-ID: <20170125223627.GA27700@amd> (raw)
In-Reply-To: <20170125222247.1210546-1-arnd@arndb.de>

[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]

On Wed 2017-01-25 23:22:36, Arnd Bergmann wrote:
> gcc gets confused about the control flow in ktd2692_parse_dt(), causing
> it to warn about what seems like a potential bug:
> 
> drivers/leds/leds-ktd2692.c: In function 'ktd2692_probe':
> drivers/leds/leds-ktd2692.c:244:15: error: '*((void *)&led_cfg+8)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/leds/leds-ktd2692.c:225:7: error: 'led_cfg.flash_max_microamp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/leds/leds-ktd2692.c:232:3: error: 'led_cfg.movie_max_microamp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> The code is fine, and slightly reworking it in an equivalent way lets
> gcc figure that out too, which gets rid of the warning.
> 
> Fixes: 77e7915b15bb ("leds: ktd2692: Add missing of_node_put")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-01-25 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 22:22 [PATCH] leds: ktd2692: avoid harmless maybe-uninitialized warning Arnd Bergmann
2017-01-25 22:36 ` Pavel Machek [this message]
2017-01-26 20:20 ` Jacek Anaszewski

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=20170125223627.GA27700@amd \
    --to=pavel@ucw.cz \
    --cc=arnd@arndb.de \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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;
as well as URLs for NNTP newsgroup(s).