From patchwork Tue Oct 29 18:07:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 11218399 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E9931390 for ; Tue, 29 Oct 2019 18:07:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 053EF20830 for ; Tue, 29 Oct 2019 18:07:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 053EF20830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D44806E505; Tue, 29 Oct 2019 18:07:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790072.outbound.protection.outlook.com [40.107.79.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC1556E4D2; Tue, 29 Oct 2019 18:07:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aqi97FLxVKLYpLb/VoGLDj2AM0Jmmlibw3EUHMfpLm+LoiPbEH407jZn9wFO9Kj1rsSCbpXutbMrdTva+bsSYawfAtUJ28+EQ1kwNLBmMq4iTzgkkZZ/2gWySTGEHG3BD6UZe5d9D/kSWbVoXNkX5PNvPKYWYrJBeCI6f4Vs7I2C78N8a7XhESp8TeiXBd1LzgYZ0S/2T/Ue6CHBCp9xATB7h02mi0T/FJ7eIVCT/8CHHuOxwROJghxQgMquoZkhJLMm0wyDb1qLoAcLnkSLWzuES/bimodB29ezQFaipA/IcAFQwn2rp+WllG28WKeucoj0XiNqntWvBtL5yqP9Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9xbnUu28uLDcQpWGEduz2HqSceFNGbLiHUicJgdL3Fo=; b=i7+07ONLry3JzuZFRo3znZ/3CzGwTxRXLG1iTGPRV+dgX7h2252pDlEGlcyZJuv27LU6zOYWQkjInZG8G75WmgWtFN+e1pmyDmh6jj4N5x0KDN74ggV7kEVdowCWsCy/Fio903uymBJ9Q7Zo55nWNvNhkyTHn2Gn7QwZaQbirmqdenOz62w2I4pBKg9YDzBjHeJecix3M2pL7z8iSbj98TZVaDeq0/AulIIWSGh4PCCRmHbnbooFrrodJ3VTOgpysArNGtnmn7vlMt5Hkh1v8viTRHeag3VxnUX2cxR1qhsEyC450pNsKnhu/Ix+84NtH8vq3Xgr17Yp/94/Venvag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=oracle.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM3PR12CA0065.namprd12.prod.outlook.com (2603:10b6:0:56::33) by CY4PR1201MB0072.namprd12.prod.outlook.com (2603:10b6:910:1b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.17; Tue, 29 Oct 2019 18:07:52 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by DM3PR12CA0065.outlook.office365.com (2603:10b6:0:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2408.17 via Frontend Transport; Tue, 29 Oct 2019 18:07:52 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM03FT015.mail.protection.outlook.com (10.152.80.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2387.20 via Frontend Transport; Tue, 29 Oct 2019 18:07:51 +0000 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 29 Oct 2019 13:07:50 -0500 Received: from agrodzovsky-All-Series.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 29 Oct 2019 13:07:50 -0500 From: Andrey Grodzovsky To: Subject: [PATCH v2] drm/sched: Fix passing zero to 'PTR_ERR' warning Date: Tue, 29 Oct 2019 14:07:48 -0400 Message-ID: <1572372468-20569-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(39860400002)(376002)(428003)(189003)(199004)(70206006)(305945005)(2351001)(50466002)(8936002)(478600001)(8676002)(50226002)(81156014)(81166006)(426003)(356004)(336012)(47776003)(51416003)(5660300002)(7696005)(53416004)(476003)(16586007)(14444005)(6916009)(316002)(36756003)(86362001)(44832011)(54906003)(186003)(70586007)(4326008)(48376002)(126002)(2906002)(486006)(2616005)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0072; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4594ba2b-ff77-4e15-63dc-08d75c9aea41 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0072: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:29; X-Forefront-PRVS: 0205EDCD76 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ujjagCQmjxRlS4E4sQazJls+PU1Rw/7KvAvd7pi/jJ0jZ7sjoM9Z0tZkPFOz34lfUA43JilH3GIamCPTo2B28oh6w5XpVhGyIwPQrmMd2usgKQqLEnR9I2dw38BxhzoABnIH+vbIAaCpHJwjFpMDknQJP70x37kpwD0UQj3UVEajcpx6K6m4D3Jw8WCnZXJFqhKbo54Gas7IG89YfnzdpS0fxZCaGlqsqkIzrJM/Z8a0TpKAX/PbS7VFyMGsGmCuTx1uvfQLB5Y8oPec6/1wNodrTYf3BH9af/IliSxZC01Ak+eJacvARtBxZxbGS5J0qllHldY4gFX+RvoKosSmmmcrll06ClZqWqga4wYNz5GUMLM8D4R7HTccZ/Bj/EpatLKAnjFaX8fVNuAnRVZriKNX7iacVG902JPdocGaO60ZbtTdmvisM9OhGUlGDhic X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2019 18:07:51.9436 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4594ba2b-ff77-4e15-63dc-08d75c9aea41 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0072 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9xbnUu28uLDcQpWGEduz2HqSceFNGbLiHUicJgdL3Fo=; b=j5DcGu57DOL24zDTtGxU49+KwUlMIp/kQI8Bl69KNbOwC8pb3mCz6wCM5yxX4f4YjX4cOofAl1HUBmetp0JrglalVcO2opx4BbAoVvu8kmPFSOXBKPEGQehwI1iB38FT1K5SN7EiHKLgKtYc2sOVJfEcBotGxEoCex6cxk4WmSc= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=permerror action=none header.from=amd.com; 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: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix a static code checker warning. v2: Drop PTR_ERR_OR_ZERO. Signed-off-by: Andrey Grodzovsky Reviewed-by: Emily Deng Reviewed-by: Christian König --- drivers/gpu/drm/scheduler/sched_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index f39b97e..dba4390 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -496,8 +496,10 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched) fence = sched->ops->run_job(s_job); if (IS_ERR_OR_NULL(fence)) { + if (IS_ERR(fence)) + dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); + s_job->s_fence->parent = NULL; - dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); } else { s_job->s_fence->parent = fence; } @@ -741,8 +743,9 @@ static int drm_sched_main(void *param) r); dma_fence_put(fence); } else { + if (IS_ERR(fence)) + dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); - dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); drm_sched_process_job(NULL, &sched_job->cb); }