From: Natale Patriciello > Sent: 28 July 2017 20:59 .. > +static __always_inline bool test_flag(u8 value, const u8 *flags) > +{ > + return (*flags & value) == value; > +} ... > + if (!test_flag(FLAG_INIT, &ca->flags)) > + return; ...
That is a completely unnecessary 'helper'. It has its arguments in the wrong order. Doesn't need to pass by reference. Since you only ever check one bit you don't need the '=='. Any error seems to be silently ignored. I bet they can't actually happen at all. David