diff mbox series

[1/3] blk-iocost: Simplify ioc_rqos_done()

Message ID 20220614175725.612878-2-bvanassche@acm.org (mailing list archive)
State New, archived
Headers show
Series Three small block layer patches | expand

Commit Message

Bart Van Assche June 14, 2022, 5:57 p.m. UTC
Leave out the superfluous "& REQ_OP_MASK" code. The definition of req_op()
shows that that code is superfluous:

 #define req_op(req) ((req)->cmd_flags & REQ_OP_MASK)

Compile-tested only.

Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-iocost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tejun Heo June 14, 2022, 6:26 p.m. UTC | #1
On Tue, Jun 14, 2022 at 10:57:23AM -0700, Bart Van Assche wrote:
> Leave out the superfluous "& REQ_OP_MASK" code. The definition of req_op()
> shows that that code is superfluous:
> 
>  #define req_op(req) ((req)->cmd_flags & REQ_OP_MASK)
> 
> Compile-tested only.
> 
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.
hch@lst.de June 15, 2022, 5:58 a.m. UTC | #2
On Tue, Jun 14, 2022 at 10:57:23AM -0700, Bart Van Assche wrote:
> Leave out the superfluous "& REQ_OP_MASK" code. The definition of req_op()
> shows that that code is superfluous:
> 
>  #define req_op(req) ((req)->cmd_flags & REQ_OP_MASK)
> 
> Compile-tested only.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 33a11ba971ea..b7082f2aed9c 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2769,7 +2769,7 @@  static void ioc_rqos_done(struct rq_qos *rqos, struct request *rq)
 	if (!ioc->enabled || !rq->alloc_time_ns || !rq->start_time_ns)
 		return;
 
-	switch (req_op(rq) & REQ_OP_MASK) {
+	switch (req_op(rq)) {
 	case REQ_OP_READ:
 		pidx = QOS_RLAT;
 		rw = READ;