[ofw] [PATCH] IPOIB_NDIS6_CM mods to make prefast happy 2 of 4

Smith, Stan stan.smith at intel.com
Fri Oct 29 16:20:08 PDT 2010


Pageable code declarations.
White-space additions/removal/alignments.

signed-off-by: stan smith <stan.smith at intel.com>

--- A/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp        Fri Oct 29 15:52:20 2010
+++ B/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp        Fri Oct 29 15:38:27 2010
@@ -34,7 +34,6 @@
 #include "Precompile.h"


-
 #if defined(EVENT_TRACING)
 #ifdef offsetof
 #undef offsetof
@@ -48,12 +47,9 @@
 #include <complib/cl_init.h>
 #include <initguid.h>
 #include <iba/ipoib_ifc.h>
-#include "ntstrsafe.h"
 #include "strsafe.h"
 #include <offload.h>

-
-
 #define MAJOR_DRIVER_VERSION 2
 #define MINOR_DRIVER_VERSION 1

@@ -64,8 +60,6 @@
 PDRIVER_OBJECT                         g_p_drv_obj;


-
-
 static const NDIS_OID SUPPORTED_OIDS[] =
 {
        OID_GEN_SUPPORTED_LIST,
@@ -265,22 +259,33 @@

 }

+extern "C" DRIVER_INITIALIZE DriverEntry;

 extern "C"
 NTSTATUS
 DriverEntry(
        IN                              PDRIVER_OBJECT                          p_drv_obj,
        IN                              PUNICODE_STRING                         p_reg_path );
+#ifdef _DEBUG_
+#pragma NDIS_PAGEABLE_FUNCTION(DriverEntry)
+#endif
+

 VOID
 ipoib_unload(
        IN                              PDRIVER_OBJECT                          p_drv_obj );

+#ifdef _DEBUG_
+extern "C"
+#endif
 NDIS_STATUS
 ipoib_initialize_ex(
        IN                              NDIS_HANDLE                     h_adapter,
        IN                              NDIS_HANDLE             config_context,
        IN PNDIS_MINIPORT_INIT_PARAMETERS       MiniportInitParameters);
+#ifdef _DEBUG_
+#pragma NDIS_PAGEABLE_FUNCTION(ipoib_initialize_ex)
+#endif

 BOOLEAN
 ipoib_check_for_hang(
@@ -735,7 +740,7 @@
                        (sizeof(eth_hdr_t) + p_adapter->params.cm_payload_mtu);
        }

-               p_adapter->params.xfer_block_size =
+       p_adapter->params.xfer_block_size =
                        (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);

        NdisReadNetworkAddress( &status, (PVOID *) p_mac, p_len, h_config );
@@ -1029,7 +1034,7 @@
        gat.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;
        gat.Header.Size = sizeof(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES);

-       gat.MediaType =                 NdisMedium802_3;
+       gat.MediaType =                 NdisMedium802_3;
        gat.MaxXmitLinkSpeed =  IPOIB_MEDIA_MAX_SPEED;
        gat.MaxRcvLinkSpeed =   IPOIB_MEDIA_MAX_SPEED;
        gat.XmitLinkSpeed =             NDIS_LINK_SPEED_UNKNOWN;
@@ -1402,10 +1407,9 @@
        ipoib_adapter_t *p_adapter,
        NDIS_HANDLE     h_adapter
        )
-       {
+{
        NTSTATUS Status;

-
        Status = SetDeviceRegistrationAttributes(p_adapter, h_adapter);
        if (Status != NDIS_STATUS_SUCCESS)
        {
@@ -2603,7 +2607,7 @@

                case OID_PNP_QUERY_POWER:
                        IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
-                               ("Port %d received query for OID_TCP_TASK_OFFLOAD\n", port_num) );
+                               ("Port %d received query for OID_PNP_QUERY_POWER\n", port_num) );
                        // Status is pre-set in this routine to Success
                        status = NDIS_STATUS_SUCCESS;
                        break;
@@ -2664,7 +2668,7 @@
                IPOIB_EXIT( IPOIB_DBG_OID );
                return NDIS_STATUS_PENDING;
 }
-
+

 static NDIS_STATUS
 ipoib_complete_query(
@@ -3964,6 +3968,7 @@
 {
        cl_free( context );
 }
+

 static NDIS_STATUS
 ipoib_pause(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_driver.cpp.patch
Type: application/octet-stream
Size: 2993 bytes
Desc: ipoib_driver.cpp.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101029/21c123d9/attachment.obj>


More information about the ofw mailing list