Received: by 10.223.164.202 with SMTP id h10csp300586wrb; Wed, 22 Nov 2017 07:25:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMY+okLnPabJCX6tVdsV24fsgBeVC0WrsJkqkkUH3rey5cRS35XOmpEI7zHGLpnbJxZZsPcg X-Received: by 10.98.224.7 with SMTP id f7mr19585612pfh.177.1511364308556; Wed, 22 Nov 2017 07:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511364308; cv=none; d=google.com; s=arc-20160816; b=U9LHGkSSepQg626mUV3FYVIpkRPGaBYYPzxFgJDxLH1Zoyo54JWs+tXKWrYJ7KMCyc RS6rGKj2VD0BWqlRR4yDlDXF544nV9pJkwDptVUpFwUhOOq5bh7PCKYXuFImPpCXKb1S d+ba0179T56/zmDYOxPFLB6efnUtixU5qWkRYT7MT+gB7HRAn3/vLw3J97Mv7NDyXBwH PTA7ch5M/6ajfz7iyvUTLzuIdqTRPaQsyFR5OeHRN/RVMQzCI6eqH81gM2Ka4lOXe9Gm KUZX7oLAPLrVSC6P53SupkJz1trjaR+GaQoVGZJXUgeVoU/MzEzBZCVaCUWUmDs/UD/D zD/Q== 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=IWycsuMHEdFRmL2RGCYEFqIVFo5+H1MZ32FzmhBdnuY=; b=Os0+OFBFNuy7tkfRY0Psuhu1lIxYBHCC53R3/go41+NFIhutCsDq1jFNWq9uhyZM9F oCTCsYnZKgu2J99k91fTX+mQpRPgDka1e8qvIYvdclJ+ozPHytdYcWJHOI5OebqqaSe1 3VVVpD4ft7JunXVN394Tw3LlOsX8r0nShOxofmbU8qAPkMR3wzxcoYSp89uSe3TTgW5K FMPxr66lmSCK0TzsDSycltgNXDTVRALklmKf87rY/SJxcMIf1mVzhbIqLKWLEv5CzEoS 5j2u1At7hu5Ly8V4rWVPgT6F+dy3G8srB56LgPXrqBpp0l0vCHL44Ptc4N+bXprqgxXl mU5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WW6kfCZH; 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 e62si2745015pfa.154.2017.11.22.07.24.57; Wed, 22 Nov 2017 07:25:08 -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=WW6kfCZH; 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 S1751921AbdKVPYW (ORCPT + 77 others); Wed, 22 Nov 2017 10:24:22 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:37328 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbdKVPYS (ORCPT ); Wed, 22 Nov 2017 10:24:18 -0500 Received: by mail-lf0-f65.google.com with SMTP id y2so17751684lfj.4 for ; Wed, 22 Nov 2017 07:24:17 -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=IWycsuMHEdFRmL2RGCYEFqIVFo5+H1MZ32FzmhBdnuY=; b=WW6kfCZH/zEHsh8REGlZl1yVAwybMuIbeHff7zBTCoqz9PXKddjU1xHoEL7LnnLzTm B/XsNyoEW1B9nZndPNNua/DdQ6AqceUqhJG9TTwB88v0V+peQ13r3i5rGLSseQDgCYB3 BSP9FjpFgVvGxCQDKFW1lXt1wgkEWLTif6O6HixMKsTc0cPfv/NFgyBXcZTZFFb0roPd watHxFVERmxkvbELzWfk2w6p2YJ+Iy+3UgHYUIGlxmow0ztDekPtq13DpdW0mjqdWiao YKXhe6P0Pa+pEsoM9RNvno/HMaVqn47pt8z7+NmDClkv5EemfFGjaZtiialc2chhXbMl 65fA== 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=IWycsuMHEdFRmL2RGCYEFqIVFo5+H1MZ32FzmhBdnuY=; b=rdGUcfi/iXHJgl5j9hIMCaTY7UpBwIZtnW/Ah9zAEw7ieWOVQh6NuD8U2AG64+zsN9 qGP+VsHhIn2mhdyZjSz33lbeLm8/1jpgqy7yuT6PM5Mwep5lDDeP0SNL+qAqCzYULz8d IEteygMChYzWl5Bu4MBzPkiW4zUwdLLdOY4hk17BZ52Op2erN3QQxdF9EnLDi9LlLq7Y mj/HiqOniZ5cVeh3e3NMI+r12BlU3fFmN82oZt/eACcIXUrBrnd29bqki4vZUH993inZ Gr/mi1UBEd47hSshQQ5Sc0/nVUQaZyFCx/Sw3HyK/Rkd5+x3L3Hmm66oyYn+r9JWs/it OAFw== X-Gm-Message-State: AJaThX5GuvgXNfM+ULTSdmauZiPvpHwepeHSnL9X1T7ZsObKFTCjZ39z 3IdcKzRXi+y9kyetAZkS2ao= X-Received: by 10.46.4.13 with SMTP id 13mr8647435lje.82.1511364256866; Wed, 22 Nov 2017 07:24:16 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id 25sm3660641ljp.78.2017.11.22.07.24.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Nov 2017 07:24:16 -0800 (PST) From: Vasyl Gomonovych To: mark.yao@rock-chips.com, airlied@linux.ie, heiko@sntech.de, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] drm/rockchip: dma-mapping: Use vma_pages helper Date: Wed, 22 Nov 2017 16:24:07 +0100 Message-Id: <1511364247-8581-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. ./drivers/gpu/drm/rockchip/rockchip_drm_gem.c:223:34-40: WARNING: Consider using vma_pages helper on vma Generated by: scripts/coccinelle/api/vma_pages.cocci Signed-off-by: Vasyl Gomonovych --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 1869c8bb76c8..1d9655576b6e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -220,7 +220,7 @@ static int rockchip_drm_gem_object_mmap_iommu(struct drm_gem_object *obj, { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); unsigned int i, count = obj->size >> PAGE_SHIFT; - unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + unsigned long user_count = vma_pages(vma); unsigned long uaddr = vma->vm_start; unsigned long offset = vma->vm_pgoff; unsigned long end = user_count + offset; -- 1.9.1 From 1585224271745091483@xxx Mon Nov 27 13:01:13 +0000 2017 X-GM-THRID: 1584827289684108527 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread