Skip to content

Commit b402328

Browse files
SurajSonawane2415axboe
authored andcommitted
block: Fix elevator_get_default() checking for NULL q->tag_set
elevator_get_default() and elv_support_iosched() both check for whether or not q->tag_set is non-NULL, however it's not possible for them to be NULL. This messes up some static checkers, as the checking of tag_set isn't consistent. Remove the checks, which both simplifies the logic and avoids checker errors. Signed-off-by: SurajSonawane2415 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 6d6e54f commit b402328

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
@@ -551,7 +551,7 @@ EXPORT_SYMBOL_GPL(elv_unregister);
551551
static inline bool elv_support_iosched(struct request_queue *q)
552552
{
553553
if (!queue_is_mq(q) ||
554-
(q->tag_set && (q->tag_set->flags & BLK_MQ_F_NO_SCHED)))
554+
(q->tag_set->flags & BLK_MQ_F_NO_SCHED))
555555
return false;
556556
return true;
557557
}
@@ -562,7 +562,7 @@ static inline bool elv_support_iosched(struct request_queue *q)
562562
*/
563563
static struct elevator_type *elevator_get_default(struct request_queue *q)
564564
{
565-
if (q->tag_set && q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
565+
if (q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
566566
return NULL;
567567

568568
if (q->nr_hw_queues != 1 &&

0 commit comments

Comments
 (0)