From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <jens.axboe@oracle.com>
Subject: [PATCH 4/4] void unregister_blkdev - make void
Date: Sat, 30 Jun 2007 12:17:02 +0900 [thread overview]
Message-ID: <20070630031702.GB4131@APFDCB5C> (raw)
In-Reply-To: <20070630031013.GC4045@APFDCB5C>
Put WARN_ON and fixed all callers of unregister_blkdev().
Now we can make unregister_blkdev return void.
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
block/genhd.c | 7 +------
include/linux/fs.h | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
Index: 2.6-mm/block/genhd.c
===================================================================
--- 2.6-mm.orig/block/genhd.c
+++ 2.6-mm/block/genhd.c
@@ -108,13 +108,11 @@ out:
EXPORT_SYMBOL(register_blkdev);
-/* todo: make void - error printk here */
-int unregister_blkdev(unsigned int major, const char *name)
+void unregister_blkdev(unsigned int major, const char *name)
{
struct blk_major_name **n;
struct blk_major_name *p = NULL;
int index = major_to_index(major);
- int ret = 0;
mutex_lock(&block_subsys_lock);
for (n = &major_names[index]; *n; n = &(*n)->next)
@@ -122,15 +120,12 @@ int unregister_blkdev(unsigned int major
break;
if (!*n || strcmp((*n)->name, name)) {
WARN_ON(1);
- ret = -EINVAL;
} else {
p = *n;
*n = p->next;
}
mutex_unlock(&block_subsys_lock);
kfree(p);
-
- return ret;
}
EXPORT_SYMBOL(unregister_blkdev);
Index: 2.6-mm/include/linux/fs.h
===================================================================
--- 2.6-mm.orig/include/linux/fs.h
+++ 2.6-mm/include/linux/fs.h
@@ -1553,7 +1553,7 @@ extern void putname(const char *name);
#ifdef CONFIG_BLOCK
extern int register_blkdev(unsigned int, const char *);
-extern int unregister_blkdev(unsigned int, const char *);
+extern void unregister_blkdev(unsigned int, const char *);
extern struct block_device *bdget(dev_t);
extern void bd_set_size(struct block_device *, loff_t size);
extern void bd_forget(struct inode *inode);
prev parent reply other threads:[~2007-06-30 3:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-30 3:10 [PATCH 1/4] void unregister_blkdev - do WARN_ON failure Akinobu Mita
2007-06-30 3:12 ` [PATCH 2/4] void unregister_blkdev - delete redundant messages Akinobu Mita
2007-06-30 3:13 ` [PATCH 2/4 -mm] void unregister_blkdev - delete redundant message Akinobu Mita
2007-06-30 6:15 ` Grant Likely
2007-06-30 6:14 ` [PATCH 2/4] void unregister_blkdev - delete redundant messages Grant Likely
2007-06-30 14:08 ` Akinobu Mita
2007-06-30 14:12 ` Grant Likely
2007-06-30 3:15 ` [PATCH 3/4] void unregister_blkdev - ignore the return value Akinobu Mita
2007-06-30 3:17 ` Akinobu Mita [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070630031702.GB4131@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.