Thread (53 messages) 53 messages, 5 authors, 2017-03-31

Re: [PATCH RFC 04/14] block, bfq: modify the peak-rate estimator

From: Bart Van Assche <hidden>
Date: 2017-03-07 01:05:35
Also in: lkml

On Sat, 2017-03-04 at 17:01 +0100, Paolo Valente wrote:
+static sector_t get_sdist(sector_t last_pos, struct request *rq)
+{
+	sector_t sdist =3D 0;
+
+	if (last_pos) {
+		if (last_pos < blk_rq_pos(rq))
+			sdist =3D blk_rq_pos(rq) - last_pos;
+		else
+			sdist =3D last_pos - blk_rq_pos(rq);
+	}
+
+	return sdist;
+}
Have you considered to use abs() from <linux/kernel.h>?

Thanks,

Bart.=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help