[ofw] [IPoIB_NDIS6_CM] [Patch 3/3] Improper IPoIB behavior during simultaneous sends on both sides

Hefty, Sean sean.hefty at intel.com
Tue Nov 9 10:32:36 PST 2010


> > -	qp_create.sq_sge = MAX_SEND_SGE < p_port->p_ca_attrs->max_sges ?
> > -			MAX_SEND_SGE  : ( p_port->p_ca_attrs->max_sges -
> > UD_QP_USED_SGE );
> > +	if ( MAX_SEND_SGE < p_port->p_ca_attrs->max_sges )
> 
> I find this notation very hard to read: "CONSTANT <operator> variable".  I
> *much* prefer variable <operator> CONSTANT.  The argument that it prevents
> errors is weak, at best, since compilers will generate warnings for
> assignment within conditionals.  When looking at this code, I have to think
> "if p_port->p_ca_attrs->max_sges > MAX_SEND_SGE" to be able to reason the
> code flow.

Agree with this I do.  Backwards makes the logic it does.



More information about the ofw mailing list