From: Roland McGrath <roland@redhat.com>
Date: Wed, 12 Mar 2008 00:13:15 +0000 (-0700)
Subject: genhd must_check warning fix
X-Git-Tag: firefly_0821_release~22020
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ee27a558ae0ff5063ccd6c47ca102c0bb0e3ba27;p=firefly-linux-kernel-4.4.55.git

genhd must_check warning fix

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>
---

diff --git a/block/genhd.c b/block/genhd.c
index c44527d16c52..00da5219ee37 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -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();