Skip to content

Commit ac4eb15

Browse files
author
Ming Lei
committed
block: remove elevator queue's type check in elv_attr_show/store()
JIRA: https://issues.redhat.com/browse/RHEL-106845 commit e25ee50 Author: Ming Lei <ming.lei@redhat.com> Date: Mon May 5 22:17:56 2025 +0800 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> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent e7d73eb commit ac4eb15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/elevator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ elv_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
425425

426426
e = container_of(kobj, struct elevator_queue, kobj);
427427
mutex_lock(&e->sysfs_lock);
428-
error = e->type ? entry->show(e, page) : -ENOENT;
428+
error = entry->show(e, page);
429429
mutex_unlock(&e->sysfs_lock);
430430
return error;
431431
}
@@ -443,7 +443,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
443443

444444
e = container_of(kobj, struct elevator_queue, kobj);
445445
mutex_lock(&e->sysfs_lock);
446-
error = e->type ? entry->store(e, page, length) : -ENOENT;
446+
error = entry->store(e, page, length);
447447
mutex_unlock(&e->sysfs_lock);
448448
return error;
449449
}

0 commit comments

Comments
 (0)