[ofw] [Patch][IPoIB_NDIS6_CM] Remove obsolete ASSERT

Hefty, Sean sean.hefty at intel.com
Tue Nov 2 10:15:53 PDT 2010


> If the assert is incorrect, then the print following it is also incorrect.
> I would rather see the assertion extended to cover the other valid states -
> assertions are a very useful way to document the code so that people can
> understand the assumptions made in functions regarding the state.  It also
> will fire if those assumptions are wrong and the code needs to be revised.

The assertion can't be correct, since the state was changed immediately before the assert.  Assertions can be nice if used judiciously, otherwise, it's just more noise added to already convoluted code.

>                                                 p_adapter->ipoib_state |=
> IPOIB_RESET_OR_DOWN;
> 
> -                                                              ASSERT(
> p_adapter->ipoib_state == IPOIB_RUNNING );



More information about the ofw mailing list