Messages in this thread | | | From | Bart Van Assche <> | Subject | Re: [PATCH RFC 04/14] block, bfq: modify the peak-rate estimator | Date | Tue, 7 Mar 2017 00:47:50 +0000 |
| |
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 = 0; > + > + if (last_pos) { > + if (last_pos < blk_rq_pos(rq)) > + sdist = blk_rq_pos(rq) - last_pos; > + else > + sdist = last_pos - blk_rq_pos(rq); > + } > + > + return sdist; > +}
Have you considered to use abs() from <linux/kernel.h>?
Thanks,
Bart.
| |