Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5123310imm; Wed, 12 Sep 2018 01:14:54 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda5LCdQDPRZiy6W+8zy7usAtZkfWUoufpyMpfHWLceBQkXxnUSLj2M1Y3/FEE1l9uWCZ31K X-Received: by 2002:a63:1064:: with SMTP id 36-v6mr838737pgq.254.1536740094471; Wed, 12 Sep 2018 01:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536740094; cv=none; d=google.com; s=arc-20160816; b=pyXWuIJ7b4JI2jFwgbuiBaeP1BQ9MReQn6cILnIIHdlm8Cn/mA3sB3akp46q2uZhOB I1/wRAJnrZLyI7IwsMBKelSmKiWKtyMdIcMKL7NSdcdIBFrOIIXibLL+l5pX/S+b8V3Q wJvpOMEdWngFiXc8JkGweTRXbTkFT+6+JQq5CS6zokskpFAAbEx4WiPm5ZbTdDaNMwfP AY7BsJ4Av+rSuQKNSoJam/RXowQbkuk8JRZne5vd9J2tIJMK9R7cfwxrpsyl0xs5vMbi 5ILVo3wYRlaSraMbcuigvsxB31cEr/B1+FOCRECby4p/ih8lozfTauK0R1H8iiWxSNdX vlAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references :subject:cc:to:from:date:message-id; bh=mbm0S7+Agg0w68pWSOQnCfTmCBcMDRuGetZ4PoFxAUY=; b=ItoKRqrMUahqoKqbJ+X0I6FlNEhDA2eoaoRm6y0z8NWew1Bcn08zug85JmZYDYWBfI FbRbDF3o3sLx4ZF4ZflpgzBE0pRrpXoE0jJAxvv27QXV8dlUOV5VeqIHmVpUOy54sEgL tVOiWecC/OWxpxFp9HCnnh4qCP6VWek7BmSxfjSJx599KD/hQloHahq1XWQICKR6mfXW GyLJSk4VUmFLMZ6YBvs4xsHjeHQVuE5hSQQQL9GpgwF1nqA0x66guxfWskvw9wmu+sbB hHYdT8fSZUUPtlBNDBHmIFRu1JeDV3WD7/McdYtfe7uM3uv8a8oPS3jsaHAx9ajH1RVy yXPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si367769pfd.39.2018.09.12.01.14.36; Wed, 12 Sep 2018 01:14:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726800AbeILNRy convert rfc822-to-8bit (ORCPT + 99 others); Wed, 12 Sep 2018 09:17:54 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:42114 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeILNRy (ORCPT ); Wed, 12 Sep 2018 09:17:54 -0400 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Wed, 12 Sep 2018 02:14:30 -0600 Message-Id: <5B98CAE202000078001E79CC@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.0.2 Date: Wed, 12 Sep 2018 02:14:26 -0600 From: "Jan Beulich" To: "Roger Pau Monne" , "Konrad Rzeszutek Wilk" Cc: "zhong jiang" , "Jens Axboe" , "xen-devel" , , Subject: Re: [Xen-devel] [PATCH] drivers/block/xen-blkback/common.h: use DIV_ROUND_UP instead of reimplementing its function References: <1536731100-56054-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: <1536731100-56054-1-git-send-email-zhongjiang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 12.09.18 at 07:45, 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