From patchwork Mon Jul 2 18:27:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10502687 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 375EA60362 for ; Mon, 2 Jul 2018 23:23:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2421328C1D for ; Mon, 2 Jul 2018 23:23:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 177D528CC5; Mon, 2 Jul 2018 23:23:06 +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 C506C28C1D for ; Mon, 2 Jul 2018 23:23:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B53506E54E; Mon, 2 Jul 2018 23:22:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 790C56E4BB for ; Mon, 2 Jul 2018 18:24:59 +0000 (UTC) Received: by mail-pg0-x241.google.com with SMTP id v13-v6so1867908pgr.10 for ; Mon, 02 Jul 2018 11:24:59 -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=ilBY72hYqwZbPPMSh+kWYp/Mo6fEgST0izjS0iYw2zI=; b=hwQ1Mo1Kw0VFns4EErUgsy8stspf867aIlzURyZykR3/R2LF2wGKOJVMqhufh2X2Oo TxEOoeODfHUp8x+JWokHo9jUqtDkRRTZ9OvwPtVfmfFPIMD4BAIBzgBN0BfhIDNDPaAV oe4XTRkNigd7KN6XXXxeyQVtQbbwVVyhBgwjvts/ONNbCiREuMgndJR0KWLnrByJeM7D GGqmE1FDsBQzfjRMQhRmxKN6EQz5DYgH+aG5S3+thT/4v6yLYDMLGEtBChLNRTUMC/5Q yIjFuFlE9NXKvgL4nyYaak/CPpH2PK2UFHsKxz2zfYaD8syPE7TrtZxuAtpw5Af/bcYd dYcA== X-Gm-Message-State: APt69E0hFfMEHc3Iyp9D5zu1CgF/FHcAFfsnbqlz2QGLO2L5wMfkulAA LzIjlhM7cPE2Y1E1Gzg+1pA= X-Google-Smtp-Source: ADUXVKJwtxV8Xv8HQwwa3a2vAM0/I93W6HQnE0uitM3XVFxBLP5CzvBDs0u16e2AIRgMAN4igs/XJQ== X-Received: by 2002:a63:b64d:: with SMTP id v13-v6mr22422556pgt.196.1530555899086; Mon, 02 Jul 2018 11:24:59 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.114]) by smtp.gmail.com with ESMTPSA id c1-v6sm2610510pgf.21.2018.07.02.11.24.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jul 2018 11:24:57 -0700 (PDT) Date: Mon, 2 Jul 2018 23:57:28 +0530 From: Souptick Joarder To: airlied@linux.ie, kraxel@redhat.com Subject: [PATCH] gpu: drm: virito: code cleanup Message-ID: <20180702182728.GA6015@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: Mon, 02 Jul 2018 23:22:39 +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: ajitn.linux@gmail.com, svptas.linux@gmail.com, sabyasachi.linux@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, brajeswar.linux@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The fault handler code is commented since v4.2. If there is no plan to enable the fault handler code in future, we can remove this dead code. Signed-off-by: Souptick Joarder --- drivers/gpu/drm/virtio/virtgpu_ttm.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c index 11f8ae5..b6f021c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c @@ -106,29 +106,6 @@ static void virtio_gpu_ttm_global_fini(struct virtio_gpu_device *vgdev) } } -#if 0 -/* - * Hmm, seems to not do anything useful. Leftover debug hack? - * Something like printing pagefaults to kernel log? - */ -static struct vm_operations_struct virtio_gpu_ttm_vm_ops; -static const struct vm_operations_struct *ttm_vm_ops; - -static int virtio_gpu_ttm_fault(struct vm_fault *vmf) -{ - struct ttm_buffer_object *bo; - struct virtio_gpu_device *vgdev; - int r; - - bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data; - if (bo == NULL) - return VM_FAULT_NOPAGE; - vgdev = virtio_gpu_get_vgdev(bo->bdev); - r = ttm_vm_ops->fault(vmf); - return r; -} -#endif - int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *file_priv; @@ -143,19 +120,8 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma) return -EINVAL; } r = ttm_bo_mmap(filp, vma, &vgdev->mman.bdev); -#if 0 - if (unlikely(r != 0)) - return r; - if (unlikely(ttm_vm_ops == NULL)) { - ttm_vm_ops = vma->vm_ops; - virtio_gpu_ttm_vm_ops = *ttm_vm_ops; - virtio_gpu_ttm_vm_ops.fault = &virtio_gpu_ttm_fault; - } - vma->vm_ops = &virtio_gpu_ttm_vm_ops; - return 0; -#else + return r; -#endif } static int virtio_gpu_invalidate_caches(struct ttm_bo_device *bdev,