On Wednesday 12 March 2008 14:25, Jeff Garzik wrote:Roland McGrath wrote:Fixes:ACK
block/genhd.c:361: warning: ignoring return value of âclass_registerâ,
declared with attribute warn_unused_result
Signed-off-by: Roland McGrath <roland@xxxxxxxxxx>
---
block/genhd.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index c44527d..00da521 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();
I was silly and simply tuned out this warning, assuming [wrongly] that
it was difficult to fix like the fs/partitions.c warning.
Shows how "helpful" those warnings are...
I don't see why? If the warning wasn't there, then Roland probably
wouldn't have noticed. So to me it shows that the warning actually
is helpful (without "") in this case.