Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4285400imw; Tue, 19 Jul 2022 03:50:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sY2n8rNUD3Sm5h+h7JBrS1DWysXXlMOjoKHH8PE/XKfs5iljtUj77/K3Clu4Z5jTk+XxS9 X-Received: by 2002:a17:907:761c:b0:6d6:e553:7bd1 with SMTP id jx28-20020a170907761c00b006d6e5537bd1mr30394145ejc.5.1658227816995; Tue, 19 Jul 2022 03:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658227816; cv=none; d=google.com; s=arc-20160816; b=uk9z7XnNJk2rppvnfNMoFowlJKCXyK51dRvq+9W3quOUQIHbGZHdh6SKgBA5fb7ONE ZKuIr8E/S/duFbnpR+CvGTTuvuO6VT9zNtdYh5nVLx+eWb/gn3rnwK4Bi1qTeVXX+T64 oZVwmWZrXclfZazEQhVIrwELdCkzoBEiW5iT2iRnNA2RqWTtA3PtFG89qN2w4dOSINgS Hzf8617Flagp985gFSLgGG8YDCy1zDf3myKjOtvyaL41szUQrMLMsnwE+qzux5PQsykH kCF+sRTkMiFWVNBbQc4DOkdgCnGF8NKxy+A+rsAxRc/1hSz2QixPYHHeTIdf1eDHSLyY DfjQ== 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 :message-id:date:subject:cc:to:from; bh=Yiy7VeaLKgc7hRFGcaYfDTxSkjZ3+W/YhZnxBcvhEKo=; b=PpwRgsY75GJQP4ufYYnU4cNSrVQdrojjgAqwYhjOwu5XMN+8BW+Be9dkA0BbPoSdBN Hj5E5wayVGCWL3jXXqTodzIQ4vrKYabCTT9gYdypvd8SpsDqDQFsIz6y24rv3PgOUi9B 4nEsQS7j1VqMfBknwgWNq8w0gji+2xBCQU/ja35RABYU5Ycyh/DEuUyvVtvmP6Qe4uv3 hMvmx6P8dS/XtKq7M7YvwaEnlR21hTLzYuYFCaAb0Wc+Vmwq5fo3OEefj+sWBuWBlxpd GBrWzNhRcpUh+QdpQGahrLff/ebRBx8/TX3T0pgR1v3+sa8Xn6fo0nqqW6B50+mWLnuT 7ntw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky6-20020a170907778600b006ff0937f440si17390668ejc.815.2022.07.19.03.49.52; Tue, 19 Jul 2022 03:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233381AbiGSKkb (ORCPT + 99 others); Tue, 19 Jul 2022 06:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235642AbiGSKk1 (ORCPT ); Tue, 19 Jul 2022 06:40:27 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EBA2315B for ; Tue, 19 Jul 2022 03:40:26 -0700 (PDT) Received: from localhost.localdomain (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPS id 4FA0340D403D; Tue, 19 Jul 2022 10:40:24 +0000 (UTC) From: Andrey Strachuk To: Alex Deucher Cc: Andrey Strachuk , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Andrey Grodzovsky , Emma Anholt , Melissa Wen , Guchun Chen , Surbhi Kakarya , Jack Zhang , Hawking Zhang , Felix Kuehling , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched() Date: Tue, 19 Jul 2022 13:39:54 +0300 Message-Id: <20220719103954.6737-1-strochuk@ispras.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Local variable 'rq' is initialized by an address of field of drm_sched_job, so it does not make sense to compare 'rq' with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Strachuk Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.") --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 67f66f2f1809..600401f2a98f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -285,10 +285,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct drm_gpu_scheduler *sched) /* Signal all jobs not yet scheduled */ for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) { struct drm_sched_rq *rq = &sched->sched_rq[i]; - - if (!rq) - continue; - spin_lock(&rq->lock); list_for_each_entry(s_entity, &rq->entities, list) { while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) { -- 2.25.1