[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3564575.fggPKDmMEE@wuerfel>
Date: Mon, 08 Dec 2014 16:46:31 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Richard Leitner <dev@...l1n.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Prabhakar Lad <prabhakar.csengg@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] misc: ioc4: simplify wave period measurement in clock_calibrate
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@...l1n.net>
Acked-by: Arnd Bergmann <arnd@...db.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists