public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Richard Leitner <dev@g0hl1n.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] misc: ioc4: simplify wave period measurement in clock_calibrate
Date: Mon, 08 Dec 2014 16:46:31 +0100	[thread overview]
Message-ID: <3564575.fggPKDmMEE@wuerfel> (raw)
In-Reply-To: <20141208162810.7b009382@frodo>

On Monday 08 December 2014 16:28:10 Richard Leitner wrote:
> The loop for measuring the square wave periods over some cycles is
> refactored to be more easily readable. This includes avoiding a
> "by-hand-implemented" for loop with a "real" one and adding some
> comments.
> 
> Furthermore the following compiler warning is avoided by this patch:
> drivers/misc/ioc4.c: In function ‘ioc4_probe’:
> drivers/misc/ioc4.c:194:16: warning: ‘start’ may be used uninitialized
> in this function [-Wmaybe-uninitialized]
>   period = (end - start) /
>                 ^
> drivers/misc/ioc4.c:148:11: note: ‘start’ was declared here
>   uint64_t start, end, period;
>            ^
> 
> Signed-off-by: Richard Leitner <dev@g0hl1n.net>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> ---
> A simplification of this loop was suggested by Andrew Morton [1].
> This is my first proposal of such a simplification.
> 
> Furthermore I'm not sure if the commit message is sufficient.
> Please give me also some feedback on it.
> 
> If this simplification is not needed only initializing start to
> ktime_get_ns() would fix the compiler warning too.

With the changed loop, do you still get a warning if you
remove the extra 'start = ktime_get_ns()' at the start of the loop?

	Arnd

  reply	other threads:[~2014-12-08 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 12:27 [PATCH] misc: ioc4: fix variable may be used uninitialized warning Richard Leitner
2014-12-08 12:42 ` Arnd Bergmann
2014-12-08 13:18   ` Richard Leitner
2014-12-08 13:34     ` Prabhakar Lad
2014-12-08 15:28       ` [PATCH] misc: ioc4: simplify wave period measurement in clock_calibrate Richard Leitner
2014-12-08 15:46         ` Arnd Bergmann [this message]
2014-12-08 15:58           ` Richard Leitner
2014-12-08 15:54         ` Paul Bolle
2014-12-08 21:03           ` Richard Leitner

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=3564575.fggPKDmMEE@wuerfel \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=dev@g0hl1n.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    /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