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

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12238#discussion_r324865219">core/include/bitarithm.h</a>:</p>
<pre style='color:#555'>> @@ -163,6 +163,47 @@ static inline unsigned bitarithm_lsb(unsigned v)
 }
 #endif
 
+/**
+ * @brief           Sets the masked bits in a word to the given value.
+ *
+ * @note            The mask should be compile-time constant so the compiler
+ *                  is able to optimize the entire loop away.
+ *
+ * @param       val The value to modify.
+ * @param[in]  mask The bitmask to apply.
+ * @param[in]  bits The new value of the masked bits.
+ *
+ */
+#define bitarithm_set_masked(val, mask, bits) do {                  \
+        const unsigned _mask = mask;                                \
</pre>
<p>When <code>bitarithm_ffs()</code> is used, they'd be one line each, right?</p>

<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/12238?email_source=notifications&email_token=ABE7WYDROTNX42U6GABEUPTQJ7SPBA5CNFSM4IW4N2Z2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE353NA#discussion_r324865219">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFV52UGYOR3TFXNE4TQJ7SPBANCNFSM4IW4N2ZQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYGLB5DLB4VS3IEC6N3QJ7SPBA5CNFSM4IW4N2Z2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE353NA.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/12238?email_source=notifications\u0026email_token=ABE7WYDROTNX42U6GABEUPTQJ7SPBA5CNFSM4IW4N2Z2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE353NA#discussion_r324865219",
"url": "https://github.com/RIOT-OS/RIOT/pull/12238?email_source=notifications\u0026email_token=ABE7WYDROTNX42U6GABEUPTQJ7SPBA5CNFSM4IW4N2Z2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE353NA#discussion_r324865219",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>