Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3196370pxj; Mon, 31 May 2021 23:15:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRGNeWuxDqp8PhuFmcVgDmi+zGmIOOOEAP2PwqdZ2SOluz6ahRU+IYQCqX0JunnR9fiK02 X-Received: by 2002:a17:906:2510:: with SMTP id i16mr5813566ejb.218.1622528140068; Mon, 31 May 2021 23:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622528140; cv=none; d=google.com; s=arc-20160816; b=VjQe/wyZPfKuBFCMyY/ipGZrHFyhXh0ygooxJcv/aAKZ7KlOHMqQRXJsVNE111Uc5d F09Ta/KGqPxu3D5Bxx6m3tzDfHFGoRcpW8N3I1yQMI/245J+acEfdBLIIiBM0XHY/GI7 z2QpXTmpxfEBuzD2W1lP8v/beLJM0bPPdJ4CBPwi1NPQPZ9F1mN3Ceoz3NXjhihcR7YE wWr1Y+W5+X/f5CbFlU1F3Ib7rKCJGngJwHcE8aDxY/mmrrI35273MMIZqaOz7O0FgcW4 Lj2kGZa611PyfA1JgmHEQ9pajFvW36Qca3ZGQjMU9EGbIX+dzJaR833BYahdydYQnMYi eA+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=bL0xlAqx6hi8PCHNASwJRZqNFuV0bfM/+oMEGitCfb4=; b=ESYBY8rsSbhjj5fj3EZKrpqr3c93G3IK/aZqbUGwJKt1s3jXy2LdQoGSlROfIydv/S 1aT1bmo7YIqQ2FaeMnV2tex877bCPbdQlze57qhMXFSm6C4VEV7vKPwJvncWy71Z/hJN 92SH1iIrr23Bw59bhH9KSyeKnWXd45qNqw+5sUIlNhSuz+yepYWYc4sKXQvOxWIxtj8T mzhofeimkW/reU/7oY35JMBpNcYWWmeqZJvlbexrHFZRFBBaykZGrJpsJORe201HXDdq JZzlunz8CxBX3wJoWbtIgZz4G4iH5QybRs11WhqZGWBiaLEdH0QLFsdzs1n5rOeGdPcT d8bA== 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 gw16si15006726ejb.250.2021.05.31.23.15.16; Mon, 31 May 2021 23:15:40 -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 S232965AbhFAGLz (ORCPT + 99 others); Tue, 1 Jun 2021 02:11:55 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2920 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbhFAGLy (ORCPT ); Tue, 1 Jun 2021 02:11:54 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FvMBV4GLPz677M; Tue, 1 Jun 2021 14:07:14 +0800 (CST) Received: from dggpeml500019.china.huawei.com (7.185.36.137) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 14:10:11 +0800 Received: from [10.174.179.189] (10.174.179.189) 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, 1 Jun 2021 14:10:11 +0800 Subject: Re: [PATCH] fuse: use DIV_ROUND_UP helper macro for calculations To: , , CC: References: <1621928447-456653-1-git-send-email-wubo40@huawei.com> From: Wu Bo Message-ID: <79744e88-7f72-ce71-c379-cf749a6ba2f4@huawei.com> Date: Tue, 1 Jun 2021 14:10:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <1621928447-456653-1-git-send-email-wubo40@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.189] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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 ping ... On 2021/5/25 15:40, Wu Bo wrote: > 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); >