osmo-pcu[master]: TS alloc: use standard function
gerrit-no-reply at lists.osmocom.org
Thu Oct 5 09:11:14 UTC 2017
Patch Set 2: Code-Review-2
> I've tried to implement this comparison and got really weird
> I might be missing smth but home come lsb in a byte can be more
> than 8? Could it be that using negation on unsigned type somehow
> confused gcc? Or some sort of template optimization magic went
This sends a red signal. First the commit message doesn't explain
the motivation. How things are verified, requires Pespin to look at
the ffs implementation and Harald to ask you to compare them. Such
churn is very dangerous. it can create subtle changes and apparently
we don't have good coverage here.
So ffs returns you the bit number (1 << ffs(16)) while pcb_lsb returns
a number with the lsb set.
> Anyway, I think it's yet another reason to replace it with standard
> function which behaves as expected.
Neither pespin nor me have used ffs. So "expected" is vague here
but the question is which semantic is expected by the code around?
To view, visit https://gerrit.osmocom.org/3896
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
More information about the gerrit-log