Received: by 10.223.164.202 with SMTP id h10csp304391wrb; Wed, 22 Nov 2017 07:28:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMb+hOrctrn7RaEA54q0VMBuis6tV1cgqrnlCq2Q+Rl9vYCeLrsep4Q2CkXtB7IV/+v3NxX7 X-Received: by 10.84.164.104 with SMTP id m37mr8501692plg.98.1511364516241; Wed, 22 Nov 2017 07:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511364516; cv=none; d=google.com; s=arc-20160816; b=WMG6q9i7SIxsnxHTg3mCpuaVoEGjlHeExdtJ8fnin1AYb9ZUQCT7R3tR2xFlKMkugS seuuG6RDu4QeURStRlXgwxuliqPso+Ppy3q28XkcWHzwbAeq5p5h9MMaN43rnHdd1Lua hv93rQ8RN7goB7uBkC5v9uZf5kqZ6ihMJSBsirVYE0weNJx6QSp68tZuJd9kOyMkACwU vW33/gSuzMd/5KFLv0a8DBSIN1xG1bZfAMrF99xiIa7ZS8SO/kSjPjyJoPTUqSgiKvLX yfxmpjHi3YWzEneQ47f6G/+v7zC1lv6MJx/j6xwleP83EiKDO8uaAVHKNertyZjadjJN zUPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WuFlo7ZGIlWrPtqzO36tI1zC2sudmEJCAGIS44RPKeM=; b=beF5H9wXE3K/GMEt+TFUCl7tlIgvQrWypoiIvYzDjhqbQuZ4S8AfyXpgBn+CfWhedb S6iv78q1R7ea8Ly263+75vWvZl0Ej+zeDmfwTv/AH5FX0DEI5baFjlVeojm1dVmFT/8A VhsUhKGlX0N9D3hHLywUwlurcvyKZzA8lXwzp77juvG3gca01rh6PIJDKja6g/qyUQHW pMZowLRENjqkK2TT3uqk0bcxot04xAVIckeOpLsGCa3RFcxSXD286H+2FC3NdFVYtUHP vR24N+k0nJqCCNkcjRCOnDE1q7k2dyc3AtgOuJsxiityr6B3NnbfPurt35kJWqTT1wby lCSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UzoimTsG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i76si13401727pgc.416.2017.11.22.07.28.24; Wed, 22 Nov 2017 07:28:36 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UzoimTsG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbdKVP1A (ORCPT + 77 others); Wed, 22 Nov 2017 10:27:00 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35029 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbdKVP07 (ORCPT ); Wed, 22 Nov 2017 10:26:59 -0500 Received: by mail-lf0-f68.google.com with SMTP id o41so18670470lfi.2 for ; Wed, 22 Nov 2017 07:26:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WuFlo7ZGIlWrPtqzO36tI1zC2sudmEJCAGIS44RPKeM=; b=UzoimTsG/co05S8Z8wRwwx7L+semxWROlZQEnohpO+Gb0zhv5QCyOgYIpr1TfpAO1b 8DHlJBCFiwL8V/tOUCbqIycTwvVPlfWntcicljBm82Yw1Fpt2RjgoSvQSv4/ZAJtw44/ yB3YJUi6L+W1u6cSS38zHEjxYZY+M9Tli2yjHxKraXxHxEBGle7tWBQCHl7wsSM1njns T34231kksZMFp88kf+dRlY0tUNdr7/cnmv6iwmtnhbE4hHh/lR8i04Qz48EQa4WcI0Qf SNFGOqUnx8zqYCgbMmy10Y6qXJk/FE/8jW2i84v34gI+B18Cbv13ljLtehsQJU9VWE0b ZFPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WuFlo7ZGIlWrPtqzO36tI1zC2sudmEJCAGIS44RPKeM=; b=lB0HXXZl4jwG3Wl58zbfsRl72glyyk5+pyiA3OZbTiJ4jA4mrBZ9x6cUWOF80VNPdR wN+uKR3TQ2jpX3P1c6smXASK9EK68VaBJTISxypGUsOuKid62bFLDW8PIPs6GFmd//35 4Xk0wZ3qgYGlz3e0n4729nQjOUt73PT4cOoZpJKs5XPeGJr2wa/JCkwulGyfzrBkVWLD g2cxAsqnO2LiiKpo6h4J9PxABI3rkCF7G3iyP4Ia/BDtIltJHBTFLwV429AV0PMTwK8F ZHz5JaZQoZW6hKPYRA5X0AKdlCWIu+bJB0c5Ith7TP9TuAT/DeaBL5eXYOGp2IF6FrT6 MR2Q== X-Gm-Message-State: AJaThX7hWdcGomIEJ4AaDcUuieOrhZbaF6lq7wvZabOsXPWfkGgCDWYO GU3aVv2RPw/LJC4aSdPYngUdsEvQ X-Received: by 10.25.219.157 with SMTP id t29mr6798319lfi.226.1511364418336; Wed, 22 Nov 2017 07:26:58 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id 13sm1902152ljv.37.2017.11.22.07.26.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Nov 2017 07:26:57 -0800 (PST) From: Vasyl Gomonovych To: dledford@redhat.com, dave@stgolabs.net, mst@redhat.com, jglisse@redhat.com, peterz@infradead.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] mm: Use vma_pages helper Date: Wed, 22 Nov 2017 16:26:50 +0100 Message-Id: <1511364410-13499-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use vma_pages function on vma object instead of explicit computation. mm/interval_tree.c:21:27-33: WARNING: Consider using vma_pages helper Generated by: scripts/coccinelle/api/vma_pages.cocci Signed-off-by: Vasyl Gomonovych --- mm/interval_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/interval_tree.c b/mm/interval_tree.c index b47664358796..27ddfd29112a 100644 --- a/mm/interval_tree.c +++ b/mm/interval_tree.c @@ -18,7 +18,7 @@ static inline unsigned long vma_start_pgoff(struct vm_area_struct *v) static inline unsigned long vma_last_pgoff(struct vm_area_struct *v) { - return v->vm_pgoff + ((v->vm_end - v->vm_start) >> PAGE_SHIFT) - 1; + return v->vm_pgoff + vma_pages(v) - 1; } INTERVAL_TREE_DEFINE(struct vm_area_struct, shared.rb, -- 1.9.1 From 1585191307554301206@xxx Mon Nov 27 04:17:16 +0000 2017 X-GM-THRID: 1585134630348398772 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread