Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4296908pxv; Mon, 19 Jul 2021 23:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8A+Z2b8BVBRr//oOCJ4AAvrZJS8Rj0XC/dQKyW7WX4Gp4yeK2zKywHVJmzomPyBbfSg8Z X-Received: by 2002:a17:907:3e02:: with SMTP id hp2mr30810918ejc.4.1626763025328; Mon, 19 Jul 2021 23:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626763025; cv=none; d=google.com; s=arc-20160816; b=AMmfi/PA78UgCqFB45W8k7sSMOSduZJuMFSxIkhYmHflzSE6qNhXU2H1StAaI8GqLb x+VSQjfVWS4FyUoGDb87G3a5RMQizQOqWNPubg1vsxzEXAUwS/LtSzRiotgFS96OU12n ePgOEX4c3Y2NCo1mvGOlH9EnyaFVRNJ++ydzW9PGQAoGl+d7BsawdGR8NZenQF+FHUa6 ZJ1fYadQ18y6PRCVgBorWp8QxCjBr2x0FWQSelWkfxfgsR6M1mdXhGlyXOizwgZRzPrK LOvgnNO+eqQ8JPIRUqF9wwq6EAQO7m7ZvcL4z3IwaolcCgJLgUtRvzzJfPfHmko94Ce8 5gdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Ey4oM/NPV3ge3VbD900XbD4gPzUkNfv5qectmrV0T5s=; b=GigyluOZ07HEAiClN4TNaMrq64UV6/tY+8TwctWV5zpe64CqyFGZ2jrfqiOk/TS5Lf Yv6bhJ0ILCerR+knEaufT3HpNAeNJe3yHUk08M9+BhLl8D2WtLuon4OdD/tLKYHoTvDR VyZwaSxo1UVazl18qXa2xRM3UuqUkHh8olONjTOXIKOs0DO3In5p5EaybZVy9Hokbnyq 89ZdVibG9tvn5REhC+6SMdTqIoWX6VC7lVb8u7KyXogFB/VmfNu/2R3w5F1Nxv75tSRA OGtjNTTA4l530OCwHDtFEELflNCbbS1Srz5YG6afItCwjN0uE/YgU5Z7IIXNGkLVnhPA o3UA== 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 dm13si20521326ejc.590.2021.07.19.23.36.41; Mon, 19 Jul 2021 23:37:05 -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 S237889AbhGTFy2 (ORCPT + 99 others); Tue, 20 Jul 2021 01:54:28 -0400 Received: from mx21.baidu.com ([220.181.3.85]:38896 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242043AbhGTFyV (ORCPT ); Tue, 20 Jul 2021 01:54:21 -0400 Received: from BJHW-Mail-Ex01.internal.baidu.com (unknown [10.127.64.11]) by Forcepoint Email with ESMTPS id 969EAFD35FF82B9BC42D; Tue, 20 Jul 2021 14:34:42 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex01.internal.baidu.com (10.127.64.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 20 Jul 2021 14:34:42 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 20 Jul 2021 14:34:41 +0800 From: Cai Huoqing To: , , , , , CC: , , , Cai Huoqing Subject: [PATCH] drm/amdkfd: move PTR_ERR under IS_ERR() condition Date: Tue, 20 Jul 2021 14:34:35 +0800 Message-ID: <20210720063435.373-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex14.internal.baidu.com (172.31.51.54) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org no need to get error code when IS_ERR is false Signed-off-by: Cai Huoqing --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index e48acdd03c1a..710659b3c1f0 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -72,16 +72,18 @@ int kfd_chardev_init(void) goto err_register_chrdev; kfd_class = class_create(THIS_MODULE, kfd_dev_name); - err = PTR_ERR(kfd_class); - if (IS_ERR(kfd_class)) + if (IS_ERR(kfd_class)) { + err = PTR_ERR(kfd_class); goto err_class_create; + } kfd_device = device_create(kfd_class, NULL, MKDEV(kfd_char_dev_major, 0), NULL, kfd_dev_name); - err = PTR_ERR(kfd_device); - if (IS_ERR(kfd_device)) + if (IS_ERR(kfd_device)) { + err = PTR_ERR(kfd_device); goto err_device_create; + } return 0; -- 2.25.1