From: Christian Lamparter Date: Thu, 24 Nov 2011 00:32:38 +0000 (+0100) Subject: carl9170 firmware: optimize get_async X-Git-Tag: 1.9.5~14 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8d6c5e6578b05a9309ff4323a84cb8d924d63623;p=carl9170fw.git carl9170 firmware: optimize get_async Signed-off-by: Christian Lamparter --- diff --git a/carlfw/include/io.h b/carlfw/include/io.h index 1186af6..4ccdc6e 100644 --- a/carlfw/include/io.h +++ b/carlfw/include/io.h @@ -81,13 +81,11 @@ static inline __inline uint32_t readl_async(const volatile void *addr) uint32_t i = 0, read, tmp; read = readl(addr); - while (i++ < 10) { + do { + tmp = read; tmp = readl(addr); - if (tmp == read) - break; - else - read = tmp; - } + i++; + } while (tmp != read && i <= 10); return read; }