[ofa-general] [mstflint] fix warnings that were reported by sparse

Dotan Barak dotanb at dev.mellanox.co.il
Wed Mar 7 07:57:53 PST 2007


Fixed warnings that were reported by sparse.

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>

---

Index: gen2_devel_user/src/userspace/mstflint/mtcr.h
===================================================================
--- gen2_devel_user.orig/src/userspace/mstflint/mtcr.h	2007-02-18 16:41:19.000000000 +0200
+++ gen2_devel_user/src/userspace/mstflint/mtcr.h	2007-02-19 10:37:37.000000000 +0200
@@ -335,7 +335,7 @@ mfile *mopen(const char *name)
   char file_name[]="/proc/bus/pci/0000:00/00.0";
 
   mf=(mfile*)malloc(sizeof(mfile));
-  if (!mf) return 0;
+  if (!mf) return NULL;
 
   //If device name starts with /proc/bus/pci we'll use configuration cycles
   if (!strncmp(name,"/proc/bus/pci/",strlen("/proc/bus/pci/")))
@@ -449,7 +449,7 @@ open_failed:
 #if CONFIG_ENABLE_MMAP
 find_failed:
 #endif
-        return 0;
+        return NULL;
 }
 #endif
 





More information about the general mailing list