[openib-general] Re: [PATCH] extend ib_device node_type to include iWarp
Roland Dreier
rdreier at cisco.com
Mon Jan 30 13:46:00 PST 2006
Sean> As long as IB_NODE_IB remains 0, we can eliminate this
Sean> change. Or we could go with something like:
Sean> if (device->node_type == IB_NODE_IB | IB_NODE_SWITCH)
That's still silly. I wasn't very clear in my original email. But my
point was that if a function does
if ((device->node_type & IB_NODE_IB) != IB_NODE_IB)
return;
then we should just write tests like
if (device->node_type == IB_NODE_SWITCH) {
a few lines later. We already know the node type is IB.
Sean> The value being returned is no longer a member of the enum,
Sean> but rather a value such as:
Sean> IB_NODE_IB | IB_NODE_CA or IB_NODE_IWARP | IB_NODE_CA.
The C standard guarantees that an enum type is an integer type that
can hold any of the members |ed together.
- R.
More information about the general
mailing list