Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4993286imm; Tue, 11 Sep 2018 22:57:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYv2L/IpFXV1ELtGgHq965Bs3nzudBbQpe2eUOrAoMRhklJcV7O5f+aofQPmHE59/4aLas1 X-Received: by 2002:a62:2b50:: with SMTP id r77-v6mr288051pfr.51.1536731860142; Tue, 11 Sep 2018 22:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536731860; cv=none; d=google.com; s=arc-20160816; b=lIZYCsJRGssOBG9qbgNXvUqFWWP7wc0Ze/JPd3cgDurq9ijYvwInhMWG9jsX4TSq82 7FM7ZOQddiGHmduwQKzmF7NpgTggiZFpjoa2nnOm0/UIak2TCPu1MATpm/RBsZWduq+y acD+XaI7IKoTLbw7rGO6OFIUbdSLYO8e1waBxcbaBjxXJi3cmrgNixypamd4dFTVqv/B 3PRcCmrZUsmETJmEmRcEDY1oefvKrJFlh+SL1vCHYTBJNihTzQFJ+ekbZPF/Bole7KYC Tws8lCU5Hlu3Zju3noQcZxuvxK7RJMRSzSzBhRD3b+ZJ/mWPW/WJ+fXozZiSlIhHojdV mAVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=AwrxWhMAF44mzQzpkc1mTQwiZrhbIjrTZG5mFFSQW9w=; b=I2LnXIfSSnik8terGxNefpixmFHKvb31RolcVSa1tNaM80knwveSb26zoP+Jt6aW3i VBpVqb0wj1WcvdpGDa94rWpn4yHoWWk6gbjCxBG9ltYsbGwj5oDsJiYubQSG5ed0djuS 3R11gixw57zXAH0D/0xd8JGzUCJ+qPCih2tswn4BFW2ICi7gAnrPlDvd0AZQSNK6XcuQ 3gCUkx4u1ZmVcIsuE1M3vokKXQbHRIVNpJfI0bkSyGesvnsu5h/RrCLe9ScVGeGZNmac hufLV89yFNJA9QyvOuph8U/yCJI4PFlIH/3XUogSrN++KrBhVeg7TVn+yP43CH1rp0FZ 4mPw== 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 o188-v6si20919pfo.236.2018.09.11.22.57.25; Tue, 11 Sep 2018 22:57:40 -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 S1726862AbeILLAN (ORCPT + 99 others); Wed, 12 Sep 2018 07:00:13 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59567 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726149AbeILLAN (ORCPT ); Wed, 12 Sep 2018 07:00:13 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 212634229B9E5; Wed, 12 Sep 2018 13:57:15 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.399.0; Wed, 12 Sep 2018 13:57:15 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH] drivers/block/xen-blkback/common.h: use DIV_ROUND_UP instead of reimplementing its function Date: Wed, 12 Sep 2018 13:45:00 +0800 Message-ID: <1536731100-56054-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DIV_ROUND_UP has implemented the code-opened function. Therefore, just replace the implementation with DIV_ROUND_UP. Signed-off-by: zhong jiang --- drivers/block/xen-blkback/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 1d3002d..874613d 100644 --- 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) /* Not a real protocol. Used to generate ring structs which contain -- 1.7.12.4