Commit 2fdd82bd authored by Adrian Bunk's avatar Adrian Bunk Committed by Jens Axboe

block: let elv_register() return void

elv_register() always returns 0, and there isn't anything it does where
it should return an error (the only error condition is so grave that
it's handled with a BUG_ON).
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 49565124
...@@ -1464,7 +1464,9 @@ static struct elevator_type iosched_as = { ...@@ -1464,7 +1464,9 @@ static struct elevator_type iosched_as = {
static int __init as_init(void) static int __init as_init(void)
{ {
return elv_register(&iosched_as); elv_register(&iosched_as);
return 0;
} }
static void __exit as_exit(void) static void __exit as_exit(void)
......
...@@ -2279,8 +2279,6 @@ static struct elevator_type iosched_cfq = { ...@@ -2279,8 +2279,6 @@ static struct elevator_type iosched_cfq = {
static int __init cfq_init(void) static int __init cfq_init(void)
{ {
int ret;
/* /*
* could be 0 on HZ < 1000 setups * could be 0 on HZ < 1000 setups
*/ */
...@@ -2292,11 +2290,9 @@ static int __init cfq_init(void) ...@@ -2292,11 +2290,9 @@ static int __init cfq_init(void)
if (cfq_slab_setup()) if (cfq_slab_setup())
return -ENOMEM; return -ENOMEM;
ret = elv_register(&iosched_cfq); elv_register(&iosched_cfq);
if (ret)
cfq_slab_kill();
return ret; return 0;
} }
static void __exit cfq_exit(void) static void __exit cfq_exit(void)
......
...@@ -467,7 +467,9 @@ static struct elevator_type iosched_deadline = { ...@@ -467,7 +467,9 @@ static struct elevator_type iosched_deadline = {
static int __init deadline_init(void) static int __init deadline_init(void)
{ {
return elv_register(&iosched_deadline); elv_register(&iosched_deadline);
return 0;
} }
static void __exit deadline_exit(void) static void __exit deadline_exit(void)
......
...@@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q) ...@@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q)
__elv_unregister_queue(q->elevator); __elv_unregister_queue(q->elevator);
} }
int elv_register(struct elevator_type *e) void elv_register(struct elevator_type *e)
{ {
char *def = ""; char *def = "";
...@@ -975,7 +975,6 @@ int elv_register(struct elevator_type *e) ...@@ -975,7 +975,6 @@ int elv_register(struct elevator_type *e)
def = " (default)"; def = " (default)";
printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def); printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
return 0;
} }
EXPORT_SYMBOL_GPL(elv_register); EXPORT_SYMBOL_GPL(elv_register);
......
...@@ -101,7 +101,9 @@ static struct elevator_type elevator_noop = { ...@@ -101,7 +101,9 @@ static struct elevator_type elevator_noop = {
static int __init noop_init(void) static int __init noop_init(void)
{ {
return elv_register(&elevator_noop); elv_register(&elevator_noop);
return 0;
} }
static void __exit noop_exit(void) static void __exit noop_exit(void)
......
...@@ -119,7 +119,7 @@ extern void elv_put_request(struct request_queue *, struct request *); ...@@ -119,7 +119,7 @@ extern void elv_put_request(struct request_queue *, struct request *);
/* /*
* io scheduler registration * io scheduler registration
*/ */
extern int elv_register(struct elevator_type *); extern void elv_register(struct elevator_type *);
extern void elv_unregister(struct elevator_type *); extern void elv_unregister(struct elevator_type *);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment