On 03/03/2011 03:27 PM, Rustad, Mark D wrote:

I think can better be done as:

/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
static int iscsi_sna_lt(u32 n1, u32 n2)
{
        s32 diff = n1 - n2;

        return diff<  0;
}

/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
static int iscsi_sna_lte(u32 n1, u32 n2)
{
        s32 diff = n1 - n2;

         return diff<= 0;
}

I think that this is both much clearer and should generate better code.

I think this has been brought up before. We have had discussions about this code a couple of times. I have to search the list some more to remember why we have not changed it. Will try to get back to you later this week.

Thanks.

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to