diff options
| author | Ming Lei <ming.lei@redhat.com> | 2025-05-05 17:17:56 +0300 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-05-06 16:43:43 +0300 |
| commit | e25ee50dfab9fce77d2e0d89d2413b6c68015f97 (patch) | |
| tree | 80254a9cbbf8e2e6b6a458663bbd689c485f4b4a | |
| parent | a3dc6279c2d5e2653b198684eb8857f414b6768f (diff) | |
| download | linux-e25ee50dfab9fce77d2e0d89d2413b6c68015f97.tar.xz | |
block: remove elevator queue's type check in elv_attr_show/store()
elevatore queue's type is assigned since its allocation, and never
get cleared until it is released.
So its ->type is always not NULL, remove the unnecessary check.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250505141805.2751237-19-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | block/elevator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/elevator.c b/block/elevator.c index eb7140a678d5..fa436417da3b 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -425,7 +425,7 @@ elv_attr_show(struct kobject *kobj, struct attribute *attr, char *page) e = container_of(kobj, struct elevator_queue, kobj); mutex_lock(&e->sysfs_lock); - error = e->type ? entry->show(e, page) : -ENOENT; + error = entry->show(e, page); mutex_unlock(&e->sysfs_lock); return error; } @@ -443,7 +443,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr, e = container_of(kobj, struct elevator_queue, kobj); mutex_lock(&e->sysfs_lock); - error = e->type ? entry->store(e, page, length) : -ENOENT; + error = entry->store(e, page, length); mutex_unlock(&e->sysfs_lock); return error; } |
