[HAL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 18 Dec 2012 09:52:07 +0000 (09:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 18 Dec 2012 09:52:07 +0000 (09:52 +0000)
Fix / silence some warnings/errors detected with VS-analyze

svn path=/trunk/; revision=57941

reactos/hal/halx86/generic/dma.c
reactos/hal/halx86/legacy/bussupp.c

index 66b8110..dcf9d14 100644 (file)
@@ -72,6 +72,8 @@
 /* INCLUDES *****************************************************************/
 
 #include <hal.h>
+#include <suppress.h>
+
 #define NDEBUG
 #include <debug.h>
 
@@ -552,6 +554,7 @@ HalpDmaInitializeEisaAdapter(IN PADAPTER_OBJECT AdapterObject,
         if (Controller == 1)
         {
             /* Set the Request Data */
+            _PRAGMA_WARNING_SUPPRESS(__WARNING_DEREF_NULL_PTR)
             WRITE_PORT_UCHAR(&((PDMA1_CONTROL)AdapterBaseVa)->Mode, DmaMode.Byte);
 
             /* Unmask DMA Channel */
index 5f45eea..4435fe4 100644 (file)
@@ -39,13 +39,16 @@ HalpAllocateBusHandler(IN INTERFACE_TYPE InterfaceType,
                           BusSpecificData,
                           NULL,
                           &Bus);
-    if (!Bus) return NULL;
+    if (!Bus)
+    {
+        return NULL;
+    }
 
     /* Check for a valid interface */
     if (InterfaceType != InterfaceTypeUndefined)
     {
         /* Allocate address ranges and zero them out */
-        Bus->BusAddresses = ExAllocatePoolWithTag(NonPagedPool,
+        Bus->BusAddresses = ExAllocatePoolWithTag(NonPagedPoolMustSucceed,
                                                   sizeof(SUPPORTED_RANGES),
                                                   ' laH');
         RtlZeroMemory(Bus->BusAddresses, sizeof(SUPPORTED_RANGES));
@@ -1153,7 +1156,7 @@ HalpAssignSlotResources(IN PUNICODE_STRING RegistryPath,
     PBUS_HANDLER Handler;
     NTSTATUS Status;
     PAGED_CODE();
-    DPRINT1("Slot assignment for %d on bus %d\n", BusType, BusNumber);
+    DPRINT1("Slot assignment for %d on bus %u\n", BusType, BusNumber);
 
     /* Find the handler */
     Handler = HalReferenceHandlerForBus(BusType, BusNumber);
@@ -1263,7 +1266,7 @@ HaliTranslateBusAddress(IN INTERFACE_TYPE InterfaceType,
     Handler = HalReferenceHandlerForBus(InterfaceType, BusNumber);
     if (!(Handler) || !(Handler->TranslateBusAddress))
     {
-        DPRINT1("No translator Interface: %x, Bus: %x, Handler: %x!\n", InterfaceType, BusNumber, Handler);
+        DPRINT1("No translator Interface: %x, Bus: %x, Handler: %p!\n", InterfaceType, BusNumber, Handler);
         return FALSE;
     }