LKML Archive on
help / color / mirror / Atom feed
From: Leonardo Potenza <>
Subject: [PATCH] block/genhd.c: compilation warning fix
Date: Mon, 11 Feb 2008 22:10:17 +0100	[thread overview]
Message-ID: <> (raw)

From: Leonardo Potenza <>

Added a check for the class_register() return value.

Signed-off-by: Leonardo Potenza <>

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

--- linux-2.6.orig/block/genhd.c
+++ linux-2.6/block/genhd.c
@@ -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);

                 reply	other threads:[~2008-02-11 21:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] block/genhd.c: compilation warning fix' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).