lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1488847656.3125.10.camel@sandisk.com>
Date:   Tue, 7 Mar 2017 00:47:50 +0000
From:   Bart Van Assche <Bart.VanAssche@...disk.com>
To:     "tj@...nel.org" <tj@...nel.org>,
        "paolo.valente@...aro.org" <paolo.valente@...aro.org>,
        "axboe@...nel.dk" <axboe@...nel.dk>
CC:     "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "fchecconi@...il.com" <fchecconi@...il.com>,
        "avanzini.arianna@...il.com" <avanzini.arianna@...il.com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "broonie@...nel.org" <broonie@...nel.org>
Subject: Re: [PATCH RFC 04/14] block, bfq: modify the peak-rate estimator

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ