]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-path-selector.c
[SCSI] zfcp: Clean up _zfcp_san_dbf_event_common_els
[linux-2.6-omap-h63xx.git] / drivers / md / dm-path-selector.c
index ac5c4bbec6c188b547ce1804be38e80bebf5a33d..ca1bb636a3e4ba808ae63d88dfbb62bc4ee28a04 100644 (file)
@@ -26,7 +26,7 @@ struct ps_internal {
 static LIST_HEAD(_path_selectors);
 static DECLARE_RWSEM(_ps_lock);
 
-struct ps_internal *__find_path_selector_type(const char *name)
+static struct ps_internal *__find_path_selector_type(const char *name)
 {
        struct ps_internal *psi;
 
@@ -86,8 +86,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 +94,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;
 }