block: simplify calling convention of elv_unregister_queue()
authorEric Biggers <ebiggers@google.com>
Mon, 24 Jan 2022 21:59:36 +0000 (13:59 -0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Feb 2022 13:40:23 +0000 (06:40 -0700)
commitf5ec592dd3bcf7c91f7c262a7f5011e001d269cd
tree4907b114a9e1fd2a3e4c05855fffc75ca2010d7e
parent483546c11d702fd6f74c8c3f8123b7672def10b2
block: simplify calling convention of elv_unregister_queue()

Make elv_unregister_queue() a no-op if q->elevator is NULL or is not
registered.

This simplifies the existing callers, as well as the future caller in
the error path of blk_register_queue().

Also don't bother checking whether q is NULL, since it never is.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220124215938.2769-2-ebiggers@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-sysfs.c
block/elevator.c