carl9170 firmware: optimize get_async
authorChristian Lamparter <chunkeey@googlemail.com>
Thu, 24 Nov 2011 00:32:38 +0000 (01:32 +0100)
committerChristian Lamparter <chunkeey@googlemail.com>
Thu, 24 Nov 2011 00:32:38 +0000 (01:32 +0100)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
carlfw/include/io.h

index 1186af61aa1a372814155b4d988b5a392a33e1b1..4ccdc6e4c8f78df780c282979cf9f1ed8e66912b 100644 (file)
@@ -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;
 }