This patch removes the mask_status local variable from ipoib_mac_from_guid.  It 
also fixes the error flow (where the assertion on mask_status used to be) to 
return the correct status value.  The assertion doesn't serve anything because 
mask_status at that point can only be IB_SUCCESS or IB_INVALID_GUID, the 
function ipoib_mac_from_guid_mask never returns anything else.

Signed-off-by: Fab Tillier <[EMAIL PROTECTED]>

--- \dev\openib\gen1\branches\WOF2-0\trunk\ulp\ipoib\kernel\ipoib_xfr_mgr.h     
Tue Sep 30 11:10:27 2008
+++ ulp\ipoib\kernel\ipoib_xfr_mgr.h    Tue Sep 30 11:11:04 2008
@@ -392,14 +392,13 @@ ipoib_mac_from_guid(
 {
        static const guid_default_mask = 0xE7; //==0b 11100111
        ib_api_status_t status = IB_INVALID_GUID;
-       ib_api_status_t mask_status = IB_SUCCESS;
        const uint8_t   *p_guid = (const uint8_t*)&port_guid;
        uint32_t                laa;

        if( guid_mask )
        {
-               mask_status = ipoib_mac_from_guid_mask( p_guid, guid_mask, 
p_mac_addr );
-               if( mask_status == IB_SUCCESS )
+               status = ipoib_mac_from_guid_mask( p_guid, guid_mask, 
p_mac_addr );
+               if( status == IB_SUCCESS )
                        return IB_SUCCESS;
        }

@@ -440,10 +439,7 @@ ipoib_mac_from_guid(
                }

                if( status == IB_SUCCESS )
-               {
-                       ASSERT ( mask_status == IB_SUCCESS || mask_status == 
IB_INVALID_GUID );
-                       return mask_status;
-               }
+                       return status;
        }

        /* Value of zero is reserved. */
@@ -459,7 +455,7 @@ ipoib_mac_from_guid(
        p_mac_addr->addr[4] = (uint8_t)(laa >> 8);
        p_mac_addr->addr[5] = (uint8_t)laa;

-       return mask_status;
+       return IB_SUCCESS;
 }
 /*
 * PARAMETERS

Attachment: ipoib_mac.2.patch
Description: ipoib_mac.2.patch

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to