Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1278943ybz; Fri, 17 Apr 2020 20:24:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIbIpfBPN/y7EbzUJT7Zw8l0qqq4lfjG6QuqRzRFHXGltjpjk8K2K8gPpnOgTgUHdoXnvn7 X-Received: by 2002:a17:906:72c8:: with SMTP id m8mr6240923ejl.318.1587180255027; Fri, 17 Apr 2020 20:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587180255; cv=none; d=google.com; s=arc-20160816; b=xKYqWpdBrLi4ZG3q1E5havRttpV2eJmcYcY2M9ymmJ2+JARlZA0/NllDz2H/VNyMmY VnE/FI4UIT1zX1wqHFMWVZLISAqyrqgKATwZBnuJULqalaGrsbJy+1d1YkZ8dgBgA6Et qPDF37rLN/sTcjbIZYRFMCCcOle/LLr3zDFNzdRUIKvG7EwneuDcPfxiCN2S7pdJAYFx yCIRXNMqqpV6ANshNcJtuvjUlnotg3yMzfx8LZx4IWSDrTRCETbIgrxqZtyrFLqs0gaO 2BHOz0jBAZ1K2uIvrDczjql+8XT4jIoPykfyVZdjAWV7q/hmNVaLJ3zaKBx7Icpycl3e 7XGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=2/w0vYY2f5GUGXzZupAQv/RZoKGBxXLP+Jpxaxwcsus=; b=l5ZMmdZNrIyOy1UhADM8lRQ+bBeiHOkaaFIH/xFwsyPBj06KmdSUtQu6JoCW5SjYVS MQfzoQXXtOCL119jb35oYKryD2wpUi/2lRtEYH9FPd26DtkhFzmkRxDfJaRzGI3p3OLY PYbcuw8Mxok0KmbZSPPcppD4bmViGvgBNSwpiRmUZmKsh2h+WEON0zwRG8AnwrwGn28a uX2EKXCn4ABC//1BaBAiRRfYKO48axa+gYRSQFHdDPGNGORrytmRXZXdsxHHF4wo9VAW s5n1KhEfKYYZP21MYWT7ROvIojIsGVpU388+I+sIHCghEg2SILrIJlar83pFUC/5NvMb 3lsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si14811335edi.324.2020.04.17.20.23.50; Fri, 17 Apr 2020 20:24:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726039AbgDRDUs (ORCPT + 99 others); Fri, 17 Apr 2020 23:20:48 -0400 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:20404 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgDRDUs (ORCPT ); Fri, 17 Apr 2020 23:20:48 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.122]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id 53852662D4B; Sat, 18 Apr 2020 11:20:45 +0800 (CST) From: Bernard Zhao To: Felix Kuehling , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] reserve_bo_and_cond_vms: Remove unnecessary condition check Date: Fri, 17 Apr 2020 20:20:36 -0700 Message-Id: <1587180037-113840-1-git-send-email-bernard@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZSFVCSE9LS0tLSk5JTkNMQllXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OTY6ORw*NDg3Sw4MHzgUIlYI N0oKCgFVSlVKTkNMSkNLS09OTkJDVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSUpJTzcG X-HM-Tid: 0a718b4d84d09373kuws53852662d4b Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to if check again, maybe we could merge into the above else branch. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 9dff792..327317c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -735,10 +735,8 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem, false, &ctx->duplicates); if (!ret) ctx->reserved = true; - else + else { pr_err("Failed to reserve buffers in ttm.\n"); - - if (ret) { kfree(ctx->vm_pd); ctx->vm_pd = NULL; } -- 2.7.4