In case readers are misled by expressions that combine multiplication and division, add parentheses to make the precedence explicit. Add similar changes to accompanying comments.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Thanks! This helps the readability of the code a little and won't trigger people's "this might be a bug" reflex. I made a couple of minor suggested tweaks to the comments for your consideration.
And thanks for the larger work that preceded this.
sys/kern/subr_blist.c | ||
---|---|---|
155 ↗ | (On Diff #31457) | s/if/since/ because m must divide BLIST_BMAP_RADIX for this code to work. |
158 ↗ | (On Diff #31457) | "so simple integer division by a constant can safely be used for the calculation" might better convey what's going on here. |
165 ↗ | (On Diff #31457) | so this is radix / ( ( 64 / 16 ) * 63 ) which works because BLIST_BMAP_RADIX % BLIST_META_RADIX == 0. OK. |
sys/kern/subr_blist.c | ||
---|---|---|
165 ↗ | (On Diff #31457) | Actually, it is radix/((64/16)*15), but it's still okay. |