From patchwork Thu May 10 15:04:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10393359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A221F60236 for ; Fri, 11 May 2018 07:06:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A105028DF6 for ; Fri, 11 May 2018 07:06:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95B8C28DF9; Fri, 11 May 2018 07:06:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2FED728DF6 for ; Fri, 11 May 2018 07:06:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA7356F046; Fri, 11 May 2018 07:06:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 461576EFA0 for ; Thu, 10 May 2018 15:02:44 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id a22-v6so1209951pfn.6 for ; Thu, 10 May 2018 08:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=R8yePPH94uZ/YTqugckdG7YDv+7JSC9lRemGY1fJL3M=; b=UkBtYaKmf6+vrRJnAK3XRCjHYXxBDj4kAziFRzAVv+rE5IzhLv0XcJDRsqTrMf5xye g2m+h79ta65K5YoxUI6XYDu4DEVyduezWFQLynxyHWic9DLuQnTbnx0cDSInPRfvxmXH BQk7X+wulG3uueiD0+nGr6THc1hBpBvIga8MG9XtLnSEr4XQP0kdeHKfB/ZWrOkBoMvs NLb6bE+hIDj57pOimfnPmSiPBZIVC91vmn1aQe9f/LA14F8WMEL52C0W4a8O+EttIJgu DjYSuTi0HaNCmy6d0Z+O8WWjiaR3iqrcSyaX43t6lvsFHaaSEMJw+p1J+M5ut5YfA1j2 ntuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=R8yePPH94uZ/YTqugckdG7YDv+7JSC9lRemGY1fJL3M=; b=dUt/EbmCDYpZbTrnXjhxAsQQurvHgxsK5eXbCxTIEKTB1AcK9JRaYAgZf2GIb8aILk x327hA+Jbs2cviOSPyNgncqWX29GyvuHyzCOOk8C4/pDBYCfStwYdjt9yVJ3b4K6td5i que9+rdqLb/pc5incxXjpNOZ7OGyfjJrJ8mB3Jy59B1Rb/jbwhDtJPjpEvzjTHrZ6wk0 m3QuAX3aiFy1bAMjpeoV570hgHf1WXxDk2ZD88Bp2v18mAPCgp8xVAlnL9+h3ZEdkH6B 5L9w3MmIWVBNMtegr12tDSCzxVtNaGDR0DVAyfyEUiZY3h5YMok60I1yzgBAuhC2y8wM Ll6g== X-Gm-Message-State: ALKqPwdniCE8WtoRKuMMl/PtUwhnDS/fDxHwMHTQ61Y4tEfD9dpaceoB uKIzfiy2Bzu/QqQAbobflxA= X-Google-Smtp-Source: AB8JxZqhTRp+XqRcM7nzmQoeTpQ7LiNpjGZrqAh83www385IFjw5/8H3idF6mIzmHTk+YaJZpxSgkA== X-Received: by 2002:a63:61c8:: with SMTP id v191-v6mr1446354pgb.184.1525964563476; Thu, 10 May 2018 08:02:43 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.218.138]) by smtp.gmail.com with ESMTPSA id 4-v6sm2667768pfn.38.2018.05.10.08.02.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 May 2018 08:02:41 -0700 (PDT) Date: Thu, 10 May 2018 20:34:48 +0530 From: Souptick Joarder To: linux@armlinux.org.uk, airlied@linux.ie Subject: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t Message-ID: <20180510150448.GA26306@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 11 May 2018 07:05:50 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: willy@infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously vm_insert_pfn() returns err which driver mapped into VM_FAULT_* type. The new function vmf_insert_pfn() will replace this inefficiency by returning VM_FAULT_* type. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Acked-by: Russell King --- v2: Updated the change log drivers/gpu/drm/armada/armada_gem.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 1.9.1 diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index a97f509..81a55b7 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -13,25 +13,14 @@ #include #include "armada_ioctlP.h" -static int armada_gem_vm_fault(struct vm_fault *vmf) +static vm_fault_t armada_gem_vm_fault(struct vm_fault *vmf) { struct drm_gem_object *gobj = vmf->vma->vm_private_data; struct armada_gem_object *obj = drm_to_armada_gem(gobj); unsigned long pfn = obj->phys_addr >> PAGE_SHIFT; - int ret; pfn += (vmf->address - vmf->vma->vm_start) >> PAGE_SHIFT; - ret = vm_insert_pfn(vmf->vma, vmf->address, pfn); - - switch (ret) { - case 0: - case -EBUSY: - return VM_FAULT_NOPAGE; - case -ENOMEM: - return VM_FAULT_OOM; - default: - return VM_FAULT_SIGBUS; - } + return vmf_insert_pfn(vmf->vma, vmf->address, pfn); } const struct vm_operations_struct armada_gem_vm_ops = {