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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux