Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1388393rwl; Fri, 7 Apr 2023 15:24:16 -0700 (PDT) X-Google-Smtp-Source: AKy350b6Bonedxg0jGOsls7SmE8iZ5/DIM8oMqdEfpx5wT0WbcDnYBob2icSmE3EK/4odEDHpuDp X-Received: by 2002:a17:907:60ce:b0:948:b667:ebbe with SMTP id hv14-20020a17090760ce00b00948b667ebbemr1008464ejc.7.1680906256147; Fri, 07 Apr 2023 15:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680906256; cv=none; d=google.com; s=arc-20160816; b=A8Rzhq2jP50SpXt9c6kGfA2xBEhGFzuTr1aXlUFI4GGe3h4SoNekLZhnh4qfi+VSK2 GMd2YazSD9LlNVCIoMCjXz3mMbfQk8lup86x5MTkUiUPAMOVqcvivaUOLaz4rsLcGJnj YaaaLpMSMRh7Vrh6AQfM9T0Nh7pwttkHFcIQAWd0JEf2VFP0eKwME+TuBRDK0EWEBrGA wCEffcy9fXzZFgjUHZ7PZ5c6yO8Uhgy2S4lx1wCFATWhECrV59LFUTWE7eyozQuF7Q1M T0s/dk9+m7ui3ktuGze/iBzqt7rHlQ0j+Sgiz1H5oq5eUwLp/5qXLZ/k+GxI358eAo5J 8NWA== 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:dkim-signature; bh=tKz0tg31KcO0axIciN8Gt+6+AOxGyPzji0GIe3mVV4M=; b=lpAq1NXQ3LzJd7dkAWvNW8CrXLi+V6k4fqdBpjRZDWye8CQU6ksYmy1g3K1fdnerbd Zl2GtrsizUsVcMHO+/9y190xCJM3kOf3LRSIhvLbzKJfSaRivv5xrZzVNO1eHRwK+gMI q8nhKXQJynS2UI4QEdyOw0zaiUxw15nTl6pwk3Pc+zy6SVLQ6tYUdZZQVYuRzZlPFVJo Z3tUZNpJKsOPsz+iLtzel1QSmL+5nwNxu+PE8/sCJAeBYLH85h5IqlVGjJCEdRIi8w0S EviS4FClH8mQrpL+KKjpaXETonmy9lKqiMHO8OlLyFfciYxj+gagRDRKlO+9wuk858Hq aIOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JypNFVrF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020aa7c70f000000b005021cd581a0si4059507edq.402.2023.04.07.15.23.52; Fri, 07 Apr 2023 15:24: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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JypNFVrF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbjDGWXD (ORCPT + 99 others); Fri, 7 Apr 2023 18:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjDGWXC (ORCPT ); Fri, 7 Apr 2023 18:23:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BA82D503 for ; Fri, 7 Apr 2023 15:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680906118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tKz0tg31KcO0axIciN8Gt+6+AOxGyPzji0GIe3mVV4M=; b=JypNFVrFFL3q5PilfpO4qiasiiQofQHRJuPbdW/dLps0roHpdTSvxvy1TDPRFT7HlFIeBV dieHn+uB0Hn6a98I9XgAy1G3jUZhY384lcQsG9nnT8Uoemxdq9Fy9tjkqXLw6wD63NPLnE YV9EJUPvQI8gonJBywMJ3QHlAR1tcnE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-376-fHMxFWKpO1Cyo62X0mtBmg-1; Fri, 07 Apr 2023 18:21:56 -0400 X-MC-Unique: fHMxFWKpO1Cyo62X0mtBmg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4201A8996E1; Fri, 7 Apr 2023 22:21:56 +0000 (UTC) Received: from emerald.redhat.com (unknown [10.22.8.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3BF951FF; Fri, 7 Apr 2023 22:21:55 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Cc: Ben Skeggs , Karol Herbst , David Airlie , Daniel Vetter , Dave Airlie , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] drm/nouveau/nvkm/outp: Use WARN_ON() in conditionals in nvkm_outp_init_route() Date: Fri, 7 Apr 2023 18:21:31 -0400 Message-Id: <20230407222133.1425969-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index 6094805fbd63..06b19883a06b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c @@ -229,10 +229,8 @@ nvkm_outp_init_route(struct nvkm_outp *outp) return; ior = nvkm_ior_find(disp, type, -1); - if (!ior) { - WARN_ON(1); + if (WARN_ON(!ior)) return; - } /* Determine the specific OR, if any, this device is attached to. */ if (ior->func->route.get) { @@ -248,10 +246,8 @@ nvkm_outp_init_route(struct nvkm_outp *outp) } ior = nvkm_ior_find(disp, type, id); - if (!ior) { - WARN_ON(1); + if (WARN_ON(!ior)) return; - } /* Determine if the OR is already configured for this device. */ ior->func->state(ior, &ior->arm); -- 2.39.2