diff mbox series

block: use req_op() to maintain consistency

Message ID 20190613141421.2698-1-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: use req_op() to maintain consistency | expand

Commit Message

Chaitanya Kulkarni June 13, 2019, 2:14 p.m. UTC
This is a pure code cleanup patch and doesn't change any functionality.
In block layer to identify the request operation req_op() macro is
used, so change the open coding the req_op() in the blk-mq-debugfs.c.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-mq-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen June 13, 2019, 4:54 p.m. UTC | #1
Chaitanya,

> This is a pure code cleanup patch and doesn't change any functionality.
> In block layer to identify the request operation req_op() macro is
> used, so change the open coding the req_op() in the blk-mq-debugfs.c.

Looks good.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke June 17, 2019, 8:41 a.m. UTC | #2
On 6/13/19 4:14 PM, Chaitanya Kulkarni wrote:
> This is a pure code cleanup patch and doesn't change any functionality.
> In block layer to identify the request operation req_op() macro is
> used, so change the open coding the req_op() in the blk-mq-debugfs.c.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  block/blk-mq-debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 6aea0ebc3a73..c6c3c4f4128a 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -341,7 +341,7 @@ static const char *blk_mq_rq_state_name(enum mq_rq_state rq_state)
>  int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
>  {
>  	const struct blk_mq_ops *const mq_ops = rq->q->mq_ops;
> -	const unsigned int op = rq->cmd_flags & REQ_OP_MASK;
> +	const unsigned int op = req_op(rq);
>  
>  	seq_printf(m, "%p {.op=", rq);
>  	if (op < ARRAY_SIZE(op_name) && op_name[op])
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Jens Axboe June 17, 2019, 3:34 p.m. UTC | #3
On 6/13/19 8:14 AM, Chaitanya Kulkarni wrote:
> This is a pure code cleanup patch and doesn't change any functionality.
> In block layer to identify the request operation req_op() macro is
> used, so change the open coding the req_op() in the blk-mq-debugfs.c.

Applied, thanks.
diff mbox series

Patch

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 6aea0ebc3a73..c6c3c4f4128a 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -341,7 +341,7 @@  static const char *blk_mq_rq_state_name(enum mq_rq_state rq_state)
 int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
 {
 	const struct blk_mq_ops *const mq_ops = rq->q->mq_ops;
-	const unsigned int op = rq->cmd_flags & REQ_OP_MASK;
+	const unsigned int op = req_op(rq);
 
 	seq_printf(m, "%p {.op=", rq);
 	if (op < ARRAY_SIZE(op_name) && op_name[op])