X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-hw-handler.c;h=2ee84d8aa0bf754244196d9189b04a10a99f2461;hb=388667bed591b2359713bb17d5de0cf56e961447;hp=ae63772e44c9c9f2b359e127704335f110aec12e;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=pandora-kernel.git diff --git a/drivers/md/dm-hw-handler.c b/drivers/md/dm-hw-handler.c index ae63772e44c9..2ee84d8aa0bf 100644 --- a/drivers/md/dm-hw-handler.c +++ b/drivers/md/dm-hw-handler.c @@ -23,7 +23,7 @@ struct hwh_internal { static LIST_HEAD(_hw_handlers); static DECLARE_RWSEM(_hwh_lock); -struct hwh_internal *__find_hw_handler_type(const char *name) +static struct hwh_internal *__find_hw_handler_type(const char *name) { struct hwh_internal *hwhi; @@ -83,8 +83,7 @@ void dm_put_hw_handler(struct hw_handler_type *hwht) if (--hwhi->use == 0) module_put(hwhi->hwht.module); - if (hwhi->use < 0) - BUG(); + BUG_ON(hwhi->use < 0); out: up_read(&_hwh_lock); @@ -92,12 +91,10 @@ void dm_put_hw_handler(struct hw_handler_type *hwht) static struct hwh_internal *_alloc_hw_handler(struct hw_handler_type *hwht) { - struct hwh_internal *hwhi = kmalloc(sizeof(*hwhi), GFP_KERNEL); + struct hwh_internal *hwhi = kzalloc(sizeof(*hwhi), GFP_KERNEL); - if (hwhi) { - memset(hwhi, 0, sizeof(*hwhi)); + if (hwhi) hwhi->hwht = *hwht; - } return hwhi; }