From patchwork Mon Jul 23 17:04:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10541377 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 211D8184F for ; Tue, 24 Jul 2018 07:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06DA5286E7 for ; Tue, 24 Jul 2018 07:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED99928744; Tue, 24 Jul 2018 07:16:59 +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 AE489286E7 for ; Tue, 24 Jul 2018 07:16:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C74A89E4C; Tue, 24 Jul 2018 07:16:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 964946E4C8 for ; Mon, 23 Jul 2018 17:01:38 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id p23-v6so799054pgv.13 for ; Mon, 23 Jul 2018 10:01:38 -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=wQ9apzApLJXSVclvpZtPTOcvoyoiwV8cVR1HtUHcYUc=; b=JiZWzTI1Xxn4SgXvEMBWoMethQn8A0eb2EiYyrrcKwMfzmgNCzNrDB5hrUj0stawQR KCbOVReGhTJqLpF6odHGdv9MaXKSAs2LeRpQEXkxO8wHE5PbB8b+fxWzFxzg43vq8kSV CS8h42fc8x6sjG/clam2+7Ycee3R/+JFoT5QAdNZmFZRK0IfdzU8AE/IwcrTUzn7Eccv nkBEj9zVgTso4U3hKSs2RYYTIG61cMJxpyN10aT7VqqA7RS4Tkyc9BHSlqOfAB1qLVTx lsc2ZQoq/PbK8TTbRblFtQR81peBLYrHRki9ksQ6MijURWvWGshIE0sn/OtkvqKLzlFX G0/g== X-Gm-Message-State: AOUpUlF1MLlRajVa7oUr0z0hbRQ1KO663s4YKd/q7n/N1ZMoqMpd7t6j ua8HIl7r24QH99XjHOdXk1I= X-Google-Smtp-Source: AAOMgpeMXaxyR9pUKSSQ8LkuCY+t0ZUVTE1wHCtUii4oFaITUU1Ga08eIaQ53xrk9VPfOWW1fONJhg== X-Received: by 2002:a63:5866:: with SMTP id i38-v6mr13028332pgm.63.1532365298178; Mon, 23 Jul 2018 10:01:38 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.219.226]) by smtp.gmail.com with ESMTPSA id z20-v6sm19981237pfd.99.2018.07.23.10.01.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jul 2018 10:01:36 -0700 (PDT) Date: Mon, 23 Jul 2018 22:34:18 +0530 From: Souptick Joarder To: willy@infradead.org, airlied@linux.ie, daniel.vetter@ffwll.ch, rodrigosiqueiramelo@gmail.com, gustavo.padovan@collabora.com, hamohammed.sa@gmail.com, jrdr.linux@gmail.com Subject: [PATCH] gpu/drm/vkms: Use new return type vm_fault_t Message-ID: <20180723170418.GA6417@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: Tue, 24 Jul 2018 07:16:52 +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: 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 --- 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]);