Hefty, Sean wrote on Tue, 2 Nov 2010 at 10:15:53

>> 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.

Perhaps the change of the state should have happened before the state was 
modified?

I wasn't suggesting the assertion was correct, just that I've seen a steady 
purging of assertions out of the code base because of code changes.  I fear 
that rather than making sure that the code is still correct in the new world 
order, we're just deleting the assertions so that they stop rearing their ugly 
heads without making sure that the assumptions that were made about the state 
are still valid.

-Fab

>>                                                 p_adapter-
>> ipoib_state |=
>> IPOIB_RESET_OR_DOWN;
>> 
>> - ASSERT( p_adapter->ipoib_state == IPOIB_RUNNING );
_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to