From patchwork Wed Aug 29 15:40:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10581275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8815814BD for ; Thu, 30 Aug 2018 07:39:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 786692B74E for ; Thu, 30 Aug 2018 07:39:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C8392B752; Thu, 30 Aug 2018 07:39: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=-3.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB 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 0868E2B74E for ; Thu, 30 Aug 2018 07:39:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6231F6E6CF; Thu, 30 Aug 2018 07:39:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFB5089F4A for ; Wed, 29 Aug 2018 15:37:13 +0000 (UTC) Received: by mail-pf1-x429.google.com with SMTP id d4-v6so2464761pfn.0 for ; Wed, 29 Aug 2018 08:37:13 -0700 (PDT) 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=J6hVXiSpP4fXof/5NV+hP4MEZFG14YBHJVShvueEB7g=; b=Gs9/9k+RyTdk91kKJvhjudJcobv8+r/q7ueKzp0QBijcGG0mxsk8Dkrze3xqGB/CXE 3vS0UfqYxqTwl0ZkCw6CTgPn7kkXNgMdbfOHqBWJxztPr6jptEU5lclab75hIa+LqTXr NL0D6i/yyLEUjnqmcCTZfGU5E2Pw/oZ/urq66usZ0SDEGp9aC/yyw+Dml/0EAIjTm9Fo /Nd1ZWvIUuaJsj/Anat7GqTUzGAOwoUk9kptbh+/kvou7hswVoLIXX0C9WJr4OSQ4gHL 6VPoKVi1+hhWlkiv1TW2Tt6Rx1qVYkq6YRq3PBI0ble9YnJqSHWTdh5IrW5nBQJveujt p6sg== X-Gm-Message-State: APzg51Ckp457M8tcrnHth3lrbXjV3YUm3V1WA/8yaGqOj/7UFXJ27Bjw vqiZRYUuJc415Gi3Frlpfwc= X-Google-Smtp-Source: ANB0VdYguM2sp/hRgwD+vloL5WK1vw337hgDyK/rgfymZTXOoJ+KeoIbTnfgrWZczW/Z3dVS8QgVhg== X-Received: by 2002:a63:9751:: with SMTP id d17-v6mr6335508pgo.386.1535557033455; Wed, 29 Aug 2018 08:37:13 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([117.242.80.10]) by smtp.gmail.com with ESMTPSA id s3-v6sm11742791pgj.84.2018.08.29.08.37.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 08:37:12 -0700 (PDT) Date: Wed, 29 Aug 2018 21:10:11 +0530 From: Souptick Joarder To: akpm@linux-foundation.org Subject: [PATCH v2] drm/vkms: Use new return type vm_fault_t Message-ID: <20180829154011.GA30885@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: Thu, 30 Aug 2018 07:39:21 +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: airlied@linux.ie, gustavo.padovan@collabora.com, 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. Signed-off-by: Souptick Joarder Signed-off-by: Gustavo Padovan --- v2: Updated patch title drivers/gpu/drm/vkms/vkms_drv.h | 2 +- drivers/gpu/drm/vkms/vkms_gem.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 07be29f..d5d04a8 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -65,7 +65,7 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev, u32 *handle, u64 size); -int vkms_gem_fault(struct vm_fault *vmf); +vm_fault_t vkms_gem_fault(struct vm_fault *vmf); int vkms_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args); diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c index c7e3836..62e05dc 100644 --- a/drivers/gpu/drm/vkms/vkms_gem.c +++ b/drivers/gpu/drm/vkms/vkms_gem.c @@ -43,14 +43,14 @@ void vkms_gem_free_object(struct drm_gem_object *obj) kfree(gem); } -int vkms_gem_fault(struct vm_fault *vmf) +vm_fault_t vkms_gem_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct vkms_gem_object *obj = vma->vm_private_data; unsigned long vaddr = vmf->address; pgoff_t page_offset; loff_t num_pages; - int ret; + vm_fault_t ret = VM_FAULT_SIGBUS; page_offset = (vaddr - vma->vm_start) >> PAGE_SHIFT; num_pages = DIV_ROUND_UP(obj->gem.size, PAGE_SIZE); @@ -58,7 +58,6 @@ int vkms_gem_fault(struct vm_fault *vmf) if (page_offset > num_pages) return VM_FAULT_SIGBUS; - ret = -ENOENT; mutex_lock(&obj->pages_lock); if (obj->pages) { get_page(obj->pages[page_offset]);