Received: by 10.223.164.202 with SMTP id h10csp35090wrb; Wed, 22 Nov 2017 15:17:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMYZnaHMDQmNWX3dvc8wgZQLJ8/VGgDocSM8kn4Ko57XCjfigPHZYAh933Ds/qe45TODgA7H X-Received: by 10.98.73.79 with SMTP id w76mr20676427pfa.148.1511392646126; Wed, 22 Nov 2017 15:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511392646; cv=none; d=google.com; s=arc-20160816; b=ux52G/owJleCG5i7eQrBlzj4Q48KI43km89JnQ8tapKhq2CpZ+ztFHyd2lVIUFoOZK v7XzxGlFJqEfNSC+1Oj3hCDAi9cbFLSLHcimw0GGyp87FnlTbNOUuWF/4pfjBIPpwDE3 AZygraiwHP5hkEEnTLg52+h5smIS8qXo9jWEQRNS+rM2G2bUrIHNBBQ1POa3GiOKQGCh WKbocQ0RgC3MU/Y1Wwh/hoqLihWpYNSTUqcv22mK61QzS71AFMHqHT8O52KiWnepoDtA v4dynVf/gPXD1lGbuGHlbPnYSlXd7YcrS4hpROL1m8P1maLEaiBDzB2iOoNgEN/NL8Wx f7ew== 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=f7kekL+tDLpAfD7UKD4CZjhwNHsEnMwAb7XKMdFARUA=; b=jLQPn/BSOFUyO5GZTzG/lA9l1E0jBCUlMdjeQP7kAUJTMdo9Tq9owTwtDq67t0S7QW FaJOFqkhczSOXrNU3MTFfp9/vTLvvCyAbzDbbqmOy9rtsM1wuygTLj4LD8j8L5Qoa5fu MdabjD/cUdwTKMYQWN0+3M5THYd7q1vzdXp3qFhJNzoWq/vUKCdrI4N/IAmNFbbZfdEJ 5xCr+wbfFXQBuzodVwnEIdaCCy3efHew9MCeRBzMmJaDXtZZuAqa14QytClKVTiD2Rv2 L0AkcVN//fJTkNS4cJ88/JpT2llGuXkanBMGG70mru6/mMzcdxLvXOvzfGhi+5cid0kJ YeGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p4DhwHBM; 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 e190si15783817pfe.93.2017.11.22.15.17.14; Wed, 22 Nov 2017 15:17:26 -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=p4DhwHBM; 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 S1752804AbdKVXQm (ORCPT + 78 others); Wed, 22 Nov 2017 18:16:42 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43473 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbdKVXQY (ORCPT ); Wed, 22 Nov 2017 18:16:24 -0500 Received: by mail-lf0-f66.google.com with SMTP id 73so20018144lfu.10 for ; Wed, 22 Nov 2017 15:16:24 -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=f7kekL+tDLpAfD7UKD4CZjhwNHsEnMwAb7XKMdFARUA=; b=p4DhwHBMNBmm+j4BxkGp5D1grY7u5dqrRluIqncDWAO4LkWBBLempJDpRhflegnjKw 7oF8N7RiQjcbOOeaEWbJvL5nTYC6DycLGNss3gDfDMdpY8tu8W7I2MsKesAQozMAN8ir Cg/OGg11vvzIVDAM/WRGzd/71oKpfssz7hCKh8Irex7UJBlmJ9aPjnjnuhoHlF+Sly6E qdEGmOdOz0HcKwA7W2HeJ0x/cX3qu1uE42LR1FoOw0m3Myo9dsqa73KrW+r0V154N2SH NyXgxABTub3nvGAMfT46E5aqwsMDn3EFd2sPBqw6ouLAAbPBN5iJ0RqvSTD7+dAF4WRm AMHQ== 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=f7kekL+tDLpAfD7UKD4CZjhwNHsEnMwAb7XKMdFARUA=; b=pNblJXaRp4lXF1OkO+f8r/To11DykPcrkQbz0zkFo9vjKZ3N15tA1Sr+K/rWwOoo5r FRC54ppZIOo7qhWYfpRIQuPyO4d2dIktael/q4N3Ic5nbi8+Qih/6VCSODZ/ljTV6iQO 1rQJVNnfiHLHqJCFbdRjgFpqOI+6B59dxw3Zg2Qv33iDAN8C0I/Z1js7qlbsMU1/2hul 4EPEHmI5bZU+lQxD2QP6iKS5uZJfBIVcygyOF0M5pR5FifG4dnO7yV2qWFAvVLGvv56f Mw/u1gCRCUT4sySkWt70OiScPs+AUKS2bZ+Df41bglt9+wlQJacGYaQH3s5VrhJZ9eKi WuWQ== X-Gm-Message-State: AJaThX78zv3OOJD04S6r/O93gYQD4GUR/jrHnhnedgP1cmpnyAL+V2BD eTDRxwry0xIri65jk+nZke0= X-Received: by 10.25.83.131 with SMTP id h3mr6784397lfl.173.1511392583314; Wed, 22 Nov 2017 15:16:23 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id 75sm3894207lja.84.2017.11.22.15.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Nov 2017 15:16:22 -0800 (PST) From: Vasyl Gomonovych To: ralf@linux-mips.org, paul.burton@mips.com, pure.logic@nexus-software.ie, akpm@linux-foundation.org, bart.vanassche@sandisk.com, vladimir.murzin@arm.com, l.stach@pengutronix.de, alexander.h.duyck@intel.com, linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] MIPS: dma-default: Use vma_pages helper Date: Thu, 23 Nov 2017 00:16:12 +0100 Message-Id: <1511392572-9254-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. arch/mips/mm/dma-default.c:182:34-40: WARNING: Consider using vma_pages helper on vma Generated by: scripts/coccinelle/api/vma_pages.cocci Signed-off-by: Vasyl Gomonovych --- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index c01bd20d0208..bfd504c92719 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c @@ -179,7 +179,7 @@ static int mips_dma_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs) { - unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + unsigned long user_count = vma_pages(vma); unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; unsigned long addr = (unsigned long)cpu_addr; unsigned long off = vma->vm_pgoff; -- 1.9.1 From 1584809253409354045@xxx Wed Nov 22 23:04:41 +0000 2017 X-GM-THRID: 1584807417538074216 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread