-#define ring_for_each(__dev, __entry) \
- for ((__entry) = (__dev)->rx; \
- (__entry) != &(__dev)->bcn[1 + \
- test_bit(DEVICE_SUPPORT_ATIM, &rt2x00dev->flags)]; \
- (__entry)++)
+#define ring_end(__dev) \
+ &(__dev)->bcn[1 + test_bit(DEVICE_SUPPORT_ATIM, &rt2x00dev->flags)]
+
+#define ring_loop(__entry, __start, __end) \
+ for ((__entry) = (__start); \
+ prefetch(&(__entry)[1]), (__entry) != (__end); \
+ (__entry) = &(__entry)[1])
+
+#define ring_for_each(__dev, __entry) \
+ ring_loop(__entry, (__dev)->rx, ring_end(__dev))
+
+#define txring_for_each(__dev, __entry) \
+ ring_loop(__entry, (__dev)->tx, (__dev)->bcn)