[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5B98CAE202000078001E79CC@prv1-mh.provo.novell.com>
Date: Wed, 12 Sep 2018 02:14:26 -0600
From: "Jan Beulich" <JBeulich@...e.com>
To: "Roger Pau Monne" <roger.pau@...rix.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>
Cc: "zhong jiang" <zhongjiang@...wei.com>,
"Jens Axboe" <axboe@...nel.dk>,
"xen-devel" <xen-devel@...ts.xenproject.org>,
<linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] drivers/block/xen-blkback/common.h:
use DIV_ROUND_UP instead of reimplementing its function
>>> On 12.09.18 at 07:45, <zhongjiang@...wei.com> wrote:
> --- a/drivers/block/xen-blkback/common.h
> +++ b/drivers/block/xen-blkback/common.h
> @@ -65,7 +65,7 @@
> (XEN_PAGES_PER_INDIRECT_FRAME / XEN_PAGES_PER_SEGMENT)
>
> #define MAX_INDIRECT_PAGES \
> - ((MAX_INDIRECT_SEGMENTS + SEGS_PER_INDIRECT_FRAME - 1)/SEGS_PER_INDIRECT_FRAME)
> + DIV_ROUND_UP(MAX_INDIRECT_SEGMENTS, SEGS_PER_INDIRECT_FRAME)
> #define INDIRECT_PAGES(_segs) DIV_ROUND_UP(_segs, XEN_PAGES_PER_INDIRECT_FRAME)
My first reaction was to suggest
#define MAX_INDIRECT_PAGES INDIRECT_PAGES(MAX_INDIRECT_SEGMENTS)
but that wouldn't match what's there currently (note the two different
divisors). I can't really decide whether that's just unfortunate naming
of the two macros, or an actual bug.
Jan
Powered by blists - more mailing lists