<p><b>@benpicco</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11929#discussion_r309447507">drivers/at24cxxx/at24cxxx.c</a>:</p>
<pre style='color:#555'>> +
+#include "include/at24cxxx_params.h"
+#include "include/at24cxxx_defines.h"
+#include "at24cxxx.h"
+
+static int _read(const at24cxxx_t *dev, uint32_t pos, uint8_t *data, size_t len)
+{
+    int check;
+    uint8_t polls = AT24CXXX_MAX_POLLS;
+
+    while ((check =
+                i2c_read_regs(dev->params.i2c, dev->params.dev_addr, pos, data,
+                              len,
+                              I2C_REG16)) == -ENXIO && --polls) {
+        xtimer_usleep(AT24CXXX_POLL_DELAY_MS * US_PER_MS);
+    }
</pre>
<p>No need to squeeze everything into the while condition, I think it's much more readable this way:</p>
⬇️ Suggested change
<pre style="color: #555">-    }
+    while ((check = i2c_read_regs(dev->params.i2c,
+                                  dev->params.dev_addr,
+                                  pos, data, len, I2C_REG16)) == -ENXIO) {
+            if (--polls == 0) {
+                break;
+            }
+            xtimer_usleep(AT24CXXX_POLL_DELAY_MS * US_PER_MS);
+    }
</pre>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11929?email_source=notifications&email_token=ABE7WYEQ4NDWQE3UDKHODETQCICM7A5CNFSM4IHRRDRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAGTXKQ#pullrequestreview-269302698">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYHMTX34CYHET3OJX7LQCICM7ANCNFSM4IHRRDRA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYASM3RJBBUOQFFONXDQCICM7A5CNFSM4IHRRDRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAGTXKQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11929?email_source=notifications\u0026email_token=ABE7WYEQ4NDWQE3UDKHODETQCICM7A5CNFSM4IHRRDRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAGTXKQ#pullrequestreview-269302698",
"url": "https://github.com/RIOT-OS/RIOT/pull/11929?email_source=notifications\u0026email_token=ABE7WYEQ4NDWQE3UDKHODETQCICM7A5CNFSM4IHRRDRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAGTXKQ#pullrequestreview-269302698",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>