Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4111653pxj; Tue, 25 May 2021 00:16:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJefB0/cLW/EF88bBHnjDPfqxweRoHGp01VoD8/aTU7fSpUSYGyYqMmDc7EedCyoM32ePc X-Received: by 2002:a92:c951:: with SMTP id i17mr19510640ilq.198.1621926970939; Tue, 25 May 2021 00:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621926970; cv=none; d=google.com; s=arc-20160816; b=wzjaEFbBIqF6a7PL8NcBOBJ89VuJpRDDlj0dfLGglDfXqvAYZrcjJe0nqjp+BD3vdj VZGAYa+VPEdVlS5B0aGNK+u5XhM0PTozPvEDpbzZltcmtMhBLs1rHdRLAg0+QHFannA4 qI/f3fuKIX/cDxkGJgBA0S9lSDbtxQjp/u5ffGe4vAXxxf1Ose37IIQBDUJC0vb/+5Em XF84yz+fBBFynCwGmC1bX+mUr8v7I+Il8RND6k6HB2XcxS6b3OOlhjyZLQ6yWA+StLB2 eyad7dKcqlUup2/PDV53+Gvd8IRPFL0WcHeQ7M/HO9NtbnRXsUKD4Y8aLNcv3Ap1kBSM NwMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ZoaIinT7kNfWDF+EBzJuDvwGETDMJZBMgFisBOXdCho=; b=dmWtSTNy2V1AS788PJInKNt1FmMgaUwcONezBf29eH0Ymj0FVkMtUtIsa5BXOU93/o Dq3+72iPSMAfQVXksdWDgJpxrIXpDJ75vVCf96qT2LRwBAW2Erv1OpZU7Ot4syJpgMXD LDgrTzEhTuaQWG7YjKOG7bVcjDQyEhmQbJ/N4PxURbRByP2Vx3IRQr+WBdItEpgk87ay 8zuwDgY7hjsmtc58zWQX1YPO4P2ZMlxWMFlkrLbSxT/bqZhm34WTkzNY9zPy9oYkdcOp 7BgXNpRwX1u8xQhAqydXHD9Cs26VBjRd8EEfV2PsAWbQoZ7JqleZwIQGYeNYhyx71m8j r+dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z20si15916972ioe.51.2021.05.25.00.15.57; Tue, 25 May 2021 00:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231524AbhEYHQl (ORCPT + 99 others); Tue, 25 May 2021 03:16:41 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3939 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhEYHQj (ORCPT ); Tue, 25 May 2021 03:16:39 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Fq4yn1GCTzBwM3; Tue, 25 May 2021 15:12:17 +0800 (CST) Received: from dggpeml500019.china.huawei.com (7.185.36.137) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 25 May 2021 15:15:08 +0800 Received: from huawei.com (10.175.124.27) by dggpeml500019.china.huawei.com (7.185.36.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 25 May 2021 15:15:08 +0800 From: Wu Bo To: , , CC: , Subject: [PATCH] fuse: use DIV_ROUND_UP helper macro for calculations Date: Tue, 25 May 2021 15:40:47 +0800 Message-ID: <1621928447-456653-1-git-send-email-wubo40@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500019.china.huawei.com (7.185.36.137) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wu Bo Replace open coded divisor calculations with the DIV_ROUND_UP kernel macro for better readability. Signed-off-by: Wu Bo --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 09ef2a4..62443eb 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1405,7 +1405,7 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii, nbytes += ret; ret += start; - npages = (ret + PAGE_SIZE - 1) / PAGE_SIZE; + npages = DIV_ROUND_UP(ret, PAGE_SIZE); ap->descs[ap->num_pages].offset = start; fuse_page_descs_length_init(ap->descs, ap->num_pages, npages); -- 1.8.3.1