[openib-general] sdp: 0 > result

Michael S. Tsirkin mst at mellanox.co.il
Thu Feb 24 13:49:28 PST 2005


OK, now what about things like these:

        if (0 > result) {
                sdp_warn("Error <%d> initializing SDP IOCB table.", result);
                goto error_iocb;
        }

may I change them all to

        if (result < 0) {

While being equivalent, we are testing the result, not 0.

Similiarly (although I feel somewhat less strongly about it)

        if (0 == result)
and
        if (NULL == conn)

are better off as

	if (!result) {
and
        if (!conn)

C is a Spartan language, and this is more brief.
Libor, I think I asked about the second one, but dont recall you
answering.
If OK to both, let me know and I'll do it on Sunday.

-- 
MST - Michael S. Tsirkin



More information about the general mailing list