OSDN Git Service

misc: ioc4: simplify wave period measurement in clock_calibrate
authorRichard Leitner <dev@g0hl1n.net>
Mon, 8 Dec 2014 15:28:10 +0000 (16:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Jan 2015 13:04:11 +0000 (05:04 -0800)
commit769105aa740dc0428f2585ec99c457d30aaab364
treea161eda1d8d09afc40537a59071a71334d89f744
parent0ec0cf19201da36af858a6bc052a13e88866f341
misc: ioc4: simplify wave period measurement in clock_calibrate

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ioc4.c