diff mbox

[06/11] bcache: Use the blk_queue_flag_{set,clear}() functions

Message ID 20180228192823.5191-7-bart.vanassche@wdc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bart Van Assche Feb. 28, 2018, 7:28 p.m. UTC
Use the blk_queue_flag_{set,clear}() functions instead of open-coding
these.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Michael Lyle <mlyle@lyle.org>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
---
 drivers/md/bcache/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Michael Lyle Feb. 28, 2018, 8:18 p.m. UTC | #1
LGTM

On Wed, Feb 28, 2018 at 11:28 AM, Bart Van Assche
<bart.vanassche@wdc.com> wrote:
> Use the blk_queue_flag_{set,clear}() functions instead of open-coding
> these.
>
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Michael Lyle <mlyle@lyle.org>
> Cc: Kent Overstreet <kent.overstreet@gmail.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> ---
>  drivers/md/bcache/super.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 312895788036..047e30cb93dc 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -833,9 +833,9 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>         q->limits.io_min                = block_size;
>         q->limits.logical_block_size    = block_size;
>         q->limits.physical_block_size   = block_size;
> -       set_bit(QUEUE_FLAG_NONROT,      &d->disk->queue->queue_flags);
> -       clear_bit(QUEUE_FLAG_ADD_RANDOM, &d->disk->queue->queue_flags);
> -       set_bit(QUEUE_FLAG_DISCARD,     &d->disk->queue->queue_flags);
> +       blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue);
> +       blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue);
> +       blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue);
>
>         blk_queue_write_cache(q, true, true);
>
> --
> 2.16.2
>
Johannes Thumshirn March 1, 2018, 8:52 a.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Martin K. Petersen March 2, 2018, 11:12 p.m. UTC | #3
Bart,

> Use the blk_queue_flag_{set,clear}() functions instead of open-coding
> these.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
diff mbox

Patch

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 312895788036..047e30cb93dc 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -833,9 +833,9 @@  static int bcache_device_init(struct bcache_device *d, unsigned block_size,
 	q->limits.io_min		= block_size;
 	q->limits.logical_block_size	= block_size;
 	q->limits.physical_block_size	= block_size;
-	set_bit(QUEUE_FLAG_NONROT,	&d->disk->queue->queue_flags);
-	clear_bit(QUEUE_FLAG_ADD_RANDOM, &d->disk->queue->queue_flags);
-	set_bit(QUEUE_FLAG_DISCARD,	&d->disk->queue->queue_flags);
+	blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue);
+	blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue);
+	blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue);
 
 	blk_queue_write_cache(q, true, true);