Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2352912pxb; Mon, 20 Sep 2021 19:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/4nQ5wsiBTRBAZ+CZvgxsVnGo5ykCoXZtx7Nsjmf51SEdstqP7iH2cfSe6wnLXFnpKT61 X-Received: by 2002:a6b:c3ce:: with SMTP id t197mr20963123iof.159.1632192632097; Mon, 20 Sep 2021 19:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192632; cv=none; d=google.com; s=arc-20160816; b=b6JpCdnqs87PDcoqun+T7BbpynBfGpGc+3naCvOS6KF8SclWxo3OjPGrxL/S9znhdN 29QEys61a11HBBEBVG7pSwTSl+00yWWLS/2wZL7exdmzCckyjJNtzMWNwZadFjR3g8Kt USHi2CXfRHOQ9ZyIG2YCzECqtm2bd1OpkcLmgtFLUo9JRTYuEWSmJvixBH+D14ln9R07 s7dCZjHhCr5u46hcnmViuDogsGDRqZiJ/k5LJXfXYfYLl4GpATTlxZmP/QE3Jfc9eQeL y3zl6mZn+KCp9Gl+z9dBL5gV5WchJtpyodaOibIbc4yL1pO7cEblG+YDBVcLSBQILLH6 vCYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VXHnkq5PPOEVumYjRPhruf7leka4YBO1l1JQ/TV7LkM=; b=T+4NnHFE1SKcDM6+rD4wEEsS6fo3fImwNl8nIolT2I9orSAV6XUlT2KDluh3uEIioh VDjCgcU90qXLaDIcC4ufF5kZMNVByopICWx8Fz5ia1x9CQ/54zMIUWRYoQjI/RrKTFIR 1hvNPDn449zgrSctuuN5E6xurupyRDzPbdTxid5GS80ZNasqFdOvtI/wsHKjxUqEcOK7 HzGZMnkghqnbCeLqP1wVww20zEWuGgdG2ZsqTNh8vdYE99mGpf3AdRs46shT/r8uBQHl ITTY5HZx837AeAFXwuYU9ke7GvW8i2ooV3d4agh0KBoxchzGTbeVpvD2GPBToUUXXJk9 /PHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sM0Hst99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si1223917ioq.87.2021.09.20.19.50.20; Mon, 20 Sep 2021 19:50:32 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sM0Hst99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349133AbhITSlZ (ORCPT + 99 others); Mon, 20 Sep 2021 14:41:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380310AbhITSgY (ORCPT ); Mon, 20 Sep 2021 14:36:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8149661ABF; Mon, 20 Sep 2021 17:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158966; bh=dJnGI+Fwo3WcJ1J/hbpXq6jVSQ53sXUs1BAejSqkMDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sM0Hst99L0g2glQ5SD2YqXgAkk8ZKapr8Tw23wqUkJwtIAPk6SS3hUAYVt13CJYnk MQqP2PIMKqbg9wsFmJgP06nxme2IeQJ0Va0h+lFJ3gDIRwZntmlz/GkyFBCx2yBHMa Bpsb9M8F/rDWdQKriHzQFl5cojx7rjBk/3/q+/Cw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nirmoy Das , =?UTF-8?q?Christian=20K=C3=B6nig?= , Shashank Sharma , Alex Deucher Subject: [PATCH 5.14 015/168] drm/amdgpu: use IS_ERR for debugfs APIs Date: Mon, 20 Sep 2021 18:42:33 +0200 Message-Id: <20210920163922.149344220@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nirmoy Das commit b04ce53eac2fc326290817a6f64a440b5bffd2e3 upstream. debugfs APIs returns encoded error so use IS_ERR for checking return value. v2: return PTR_ERR(ent) Signed-off-by: Nirmoy Das Reviewed-by: Christian König Reviewed-By: Shashank Sharma Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1544,20 +1544,18 @@ int amdgpu_debugfs_init(struct amdgpu_de struct dentry *ent; int r, i; - - ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev, &fops_ib_preempt); - if (!ent) { + if (IS_ERR(ent)) { DRM_ERROR("unable to create amdgpu_preempt_ib debugsfs file\n"); - return -EIO; + return PTR_ERR(ent); } ent = debugfs_create_file("amdgpu_force_sclk", 0200, root, adev, &fops_sclk_set); - if (!ent) { + if (IS_ERR(ent)) { DRM_ERROR("unable to create amdgpu_set_sclk debugsfs file\n"); - return -EIO; + return PTR_ERR(ent); } /* Register debugfs entries for amdgpu_ttm */ --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -428,8 +428,8 @@ int amdgpu_debugfs_ring_init(struct amdg ent = debugfs_create_file(name, S_IFREG | S_IRUGO, root, ring, &amdgpu_debugfs_ring_fops); - if (!ent) - return -ENOMEM; + if (IS_ERR(ent)) + return PTR_ERR(ent); i_size_write(ent->d_inode, ring->ring_size + 12); ring->ent = ent;