Dear mailing list,

I've been asked in https://review.coreboot.org/42134 to please start a
discussion on the mailing list about the naming convention of the
functions I've added in said patch.

I decided to use `unset_and_set` because that's what libgfxinit uses.
In coreboot, we already have `clrsetbits` to operate on memory-mapped
addresses. However, `pci_update_config` functions have different
semantics, as they take an and-mask instead of an unset-mask. This
requires one to use explicit casts to silence spurious overflow
warnings if using bitwise negations on shorter-than-int types and the
most significant bit is set. Since the added functions operate on
bytes, the casts are necessary too often, which clutters the code and
suppresses valid overflow warnings. Using an unset-mask solves all
these problems, but having `update` in the names of two function
families with different semantics would be too cruel. And `clrsetbits`
doesn't look too good as a middle `word` in a function name, which is
why I went with `unset_and_set` instead.

Any thoughts?

Best regards,
Angel
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to