mtip32xx: Use the blk_queue_flag_*() functions
authorBart Van Assche <bart.vanassche@wdc.com>
Thu, 8 Mar 2018 01:10:06 +0000 (17:10 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Mar 2018 21:13:48 +0000 (14:13 -0700)
Use the blk_queue_flag_*() functions instead of open-coding these.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c

index b8af735..769c551 100644 (file)
@@ -159,7 +159,7 @@ static bool mtip_check_surprise_removal(struct pci_dev *pdev)
        if (vendor_id == 0xFFFF) {
                dd->sr = true;
                if (dd->queue)
-                       set_bit(QUEUE_FLAG_DEAD, &dd->queue->queue_flags);
+                       blk_queue_flag_set(QUEUE_FLAG_DEAD, dd->queue);
                else
                        dev_warn(&dd->pdev->dev,
                                "%s: dd->queue is NULL\n", __func__);
@@ -3855,8 +3855,8 @@ skip_create_disk:
                goto start_service_thread;
 
        /* Set device limits. */
-       set_bit(QUEUE_FLAG_NONROT, &dd->queue->queue_flags);
-       clear_bit(QUEUE_FLAG_ADD_RANDOM, &dd->queue->queue_flags);
+       blk_queue_flag_set(QUEUE_FLAG_NONROT, dd->queue);
+       blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, dd->queue);
        blk_queue_max_segments(dd->queue, MTIP_MAX_SG);
        blk_queue_physical_block_size(dd->queue, 4096);
        blk_queue_max_hw_sectors(dd->queue, 0xffff);
@@ -3866,7 +3866,7 @@ skip_create_disk:
 
        /* Signal trim support */
        if (dd->trim_supp == true) {
-               set_bit(QUEUE_FLAG_DISCARD, &dd->queue->queue_flags);
+               blk_queue_flag_set(QUEUE_FLAG_DISCARD, dd->queue);
                dd->queue->limits.discard_granularity = 4096;
                blk_queue_max_discard_sectors(dd->queue,
                        MTIP_MAX_TRIM_ENTRY_LEN * MTIP_MAX_TRIM_ENTRIES);