]> err.no Git - linux-2.6/commitdiff
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 c44527d16c52d66058ca434e8c6e5af05b8874c6..00da5219ee37c02a066d45e6ceefa65d9606d5e6 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)
 {
-       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();