> > >I believe we should use only a single source for what we need. If we > > >rely on ngpios, the bgpio_bits should be recalculated based on it. > > >The expression doing this is very simple. Something like > > >round_up(ngpios, 8); > > > > Right, mistakes happen. Also I don't want to blame anyone, because it > happens to work fine on little endian systems, and big endian systems are so > rare it's easy to forget that they exist ;-) > > > Now, if we want to not modify bgpio_bits, we could go back to my v3 patch. > > ngpio is the number of gpio pins supported while bgpio_bits is the register > access bit type. These are 2 different entities. > > Exactly. And AFAICT this patch does exactly this, restoring the code to the > state of v3. > LGTM then 😊. Thanks!