genhd must_check warning fix
authorRoland McGrath <roland@redhat.com>
Wed, 12 Mar 2008 00:13:15 +0000 (17:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Mar 2008 19:34:37 +0000 (12:34 -0700)
Fixes:

block/genhd.c:361: warning: ignoring return value of â€˜class_register’, declared with attribute warn_unused_result

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
block/genhd.c

index c44527d..00da521 100644 (file)
@@ -360,7 +360,9 @@ static struct kobject *base_probe(dev_t devt, int *part, void *data)
 
 static int __init genhd_device_init(void)
 {
 
 static int __init genhd_device_init(void)
 {
-       class_register(&block_class);
+       int error = class_register(&block_class);
+       if (unlikely(error))
+               return error;
        bdev_map = kobj_map_init(base_probe, &block_class_lock);
        blk_dev_init();
 
        bdev_map = kobj_map_init(base_probe, &block_class_lock);
        blk_dev_init();