]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-path-selector.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
[linux-2.6-omap-h63xx.git] / drivers / md / dm-path-selector.c
index a28c1c2b4ef5c703d2d5ce4f5c67bb2858483542..96ea226155b10e3dbb560b3faa8c2211ec11f41f 100644 (file)
@@ -9,7 +9,8 @@
  * Path selector registration.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-path-selector.h"
 
 #include <linux/slab.h>
@@ -86,8 +87,7 @@ void dm_put_path_selector(struct path_selector_type *pst)
        if (--psi->use == 0)
                module_put(psi->pst.module);
 
-       if (psi->use < 0)
-               BUG();
+       BUG_ON(psi->use < 0);
 
 out:
        up_read(&_ps_lock);
@@ -95,12 +95,10 @@ out:
 
 static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst)
 {
-       struct ps_internal *psi = kmalloc(sizeof(*psi), GFP_KERNEL);
+       struct ps_internal *psi = kzalloc(sizeof(*psi), GFP_KERNEL);
 
-       if (psi) {
-               memset(psi, 0, sizeof(*psi));
+       if (psi)
                psi->pst = *pst;
-       }
 
        return psi;
 }