Skip to contentSkip to conversation

block/genhd.c: compilation warning fix

PATCH New Leonardo Potenza 1 participant 1 message Feb 11, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/genhd.c: compilation warning fix

From: Leonardo Potenza <[email protected]>

Added a check for the class_register() return value.

---

The aim of this patch is to remove the following warning message:
block/genhd.c: In function 'genhd_device_init':
block/genhd.c:361: warning: ignoring return value of 'class_register', declared with attribute warn_unused_result

block/genhd.c +6 -1
@@ -358,7 +358,12 @@ static struct kobject *base_probe(dev_t 
 
 static int __init genhd_device_init(void)
 {
-	class_register(&block_class);
+	int ret;
+
+	ret = class_register(&block_class);
+	if (ret != 0)
+		return ret;
+
 	bdev_map = kobj_map_init(base_probe, &block_class_lock);
 	blk_dev_init();