[ofw] Re: [PATCH v2] [ib-diag] saquery: add support for WinOF

Sasha Khapyorsky sashak at voltaire.com
Fri Feb 27 10:59:05 PST 2009


On 09:51 Fri 27 Feb     , Sean Hefty wrote:
> >>   - modify CHECK_AND_SET_VAL - comparison is done as signed, but assignments
> >>     are unsigned.  This is kind of confusing, but that's how it appears the
> >>     macro is used.  It might be clearer if instead of passing -1 into the
> >>     macro, that a SET_VAL macro be used instead.
> >
> >What do you mean? Another macro?
> 
> yes -- instead of passing -1 into CHECK_AND_SET_VAL as the value to compare
> against, call a different macro that just sets the value, unless I'm
> misunderstanding why -1 is passed in.  Then CHECK_AND_SET_VAL would do unsigned
> comparisons.
> 
> I can submit a patch for this, but I wasn't completely sure of the intent of
> using -1 as the compare value.

For some parameters (such as SL) "0" is valid value and could be
specified using command line options, so I used -1 as initial value to
mark such parameters as non-requested for the query (so its comp_mask is
not selected at all).

Sasha



More information about the ofw mailing list