osmo-pcu[master]: TS alloc: use standard function

Holger Freyther 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
 > results:

 > 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
 > wrong?

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-MessageType: comment
Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
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>
Gerrit-HasComments: No

More information about the gerrit-log mailing list