From: Roland McGrath Date: Wed, 12 Mar 2008 00:13:15 +0000 (-0700) Subject: genhd must_check warning fix X-Git-Tag: v2.6.25-rc6~38 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=ee27a558ae0ff5063ccd6c47ca102c0bb0e3ba27 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 Acked-by: Jeff Garzik Signed-off-by: Linus Torvalds --- 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();