From patchwork Thu Jul 26 14:45:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10546663 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 DB7BB174A for ; Fri, 27 Jul 2018 07:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDCF82B4C9 for ; Fri, 27 Jul 2018 07:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C20BE2B4CC; Fri, 27 Jul 2018 07:02:11 +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.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 850B22B4C9 for ; Fri, 27 Jul 2018 07:02:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C98256E900; Fri, 27 Jul 2018 07:01:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by gabe.freedesktop.org (Postfix) with ESMTPS id 396466E241 for ; Thu, 26 Jul 2018 14:43:07 +0000 (UTC) Received: by mail-pg1-x536.google.com with SMTP id v13-v6so1297871pgr.10 for ; Thu, 26 Jul 2018 07:43:07 -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=gaRxWTaM+/B1bndN88ySOF59LMcH/P+2+1B2IyLMpx4=; b=H0oz8qvGFJp8QzlpRkibGwiGaSCTS56ySBKn6rA7mP/NOdRsJhldsEeBVOq6k1LCy+ VsdxHR/EWoHt4XytSKgh3rOgxjzIVahe4uNG0IV6sudIY10OznG2/tdgu19kvBPItY4f NDEutV4ZaToVf6FEPa9M/3r81k2LOZRqFexsPUfrpHhJsHq4vNqGkIpWySuYOdE0/6aY y3dFdLy5VIlc1ZB10iXYTh2ZlvJ8oI2NpV8899yc9kf/qfN9s5jn++QB8M74mZRBmD3R osf7PKBf2vBXc6iNA2M6H4mplrJhxTESTat1h7TjYozvkcdrHtej5VbRmyXOcAOAOUAK 12FA== X-Gm-Message-State: AOUpUlGU1CcL6T8oOkEdlxEimlzpo63mN1tEdXaiOQpgO6ULJEYo7L9v VUDsSkw/38LJogiZ9vZp8wU= X-Google-Smtp-Source: AAOMgpf2rpBfHgn/X+IQumUUBz9DqtwtipeZZ/4yOEOpUA8l4fzxrS8Kh5pWNsImAt609Py1lN/w+Q== X-Received: by 2002:a65:48cd:: with SMTP id o13-v6mr2153536pgs.99.1532616186791; Thu, 26 Jul 2018 07:43:06 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.219.162]) by smtp.gmail.com with ESMTPSA id k26-v6sm6988100pfb.167.2018.07.26.07.43.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Jul 2018 07:43:05 -0700 (PDT) Date: Thu, 26 Jul 2018 20:15:49 +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 Subject: [PATCH v2] drm/vkms: Use new return type vm_fault_t Message-ID: <20180726144549.GA9434@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, 27 Jul 2018 07:01:20 +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 Reviewed-by: Rodrigo Siqueira --- 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]);