[ofw] RE: PATCH: Fix error handling of mlx4_bus driver.
Tzachi Dar
tzachid at mellanox.co.il
Wed Feb 11 02:47:26 PST 2009
Applied on 1941.
As for Fab comment:
I have seen cases in which the cause was something like:
If ((prot !=6) &&
((tcp.src.port == 57) || (tcp.dst.port == 57)) &&
(! Config.state != on)) {
ASSERT(FALSE);
return;
}
At this cases writing the assert correctly (and maintaining it) becomes
very hard.
So, I got my self a habit to use ASSERT(FALSE) which is very easy to
read / maintain.
In any case, the places that Fab has indicated were simple, so I have
changed them based
On his request.
Thanks
Tzachi
> -----Original Message-----
> From: Fab Tillier [mailto:ftillier at windows.microsoft.com]
> Sent: Monday, February 09, 2009 8:07 PM
> To: Tzachi Dar; ofw at lists.openfabrics.org
> Subject: RE: PATCH: Fix error handling of mlx4_bus driver.
>
> >Index: Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/device.c
> >===================================================================
> >--- Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/device.c
> (revision 3919)
> >+++ Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/device.c
> (revision 3920)
> >@@ -332,6 +332,11 @@
> > struct ib_client_data *context, *tmp;
> > unsigned long flags;
> >
> >+ if(device->reg_state != IB_DEV_REGISTERED) { ASSERT(FALSE);
>
> This would be better as ASSERT( device->reg_state ==
> IB_DEV_REGISTERED ) - that makes the assertion message a
> little clearer, and will have the same effect.
>
> >+ return;
> >+ }
> >+
>
More information about the ofw
mailing list