Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp892320pxp; Wed, 16 Mar 2022 20:23:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqyUXv8Sf5FaHbEOIEK7Szs3aeRboO5Wgd9t9RPlSJf28afYZrcippKlhAtmlz/sTYSXaW X-Received: by 2002:a62:8ccb:0:b0:4f6:ee14:9c1e with SMTP id m194-20020a628ccb000000b004f6ee149c1emr2367527pfd.19.1647487429782; Wed, 16 Mar 2022 20:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647487429; cv=none; d=google.com; s=arc-20160816; b=lIFBti7tUZQQ1ahtxVkW3lt97HRrmKL6DLiqBGygYiAN5E1rQs1EhKfZ5p6xhpFufs 6KWUtXXlvcoX+0DQQGUvkE87fnAUALNhg7sjHcWijLFoJqmOW2/MgjgvrXFNG2TQPp1W BmoLl0L7oGoezXEqlFKuKorpAP1PH5JkvvKa1QXd/hOrOfsdnC/aqn89oNDW/FmIz1PN Wa89z68DBA4DbLah9Cq0qKiSBpeZen9NvPSSATpMMUgbnBqY/qejXBuBK9BD+K4jcQcL gd41nzzKmwfGiJBI+5ujllzrwTFAtwJ9swuOVIyeF5roF0bJyzAW/6TJmpogj9l/S8e+ 6y5g== 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=Efhvml1IcnY8sxboimFEm/a5V8BDCfLirW3ey3dQ5UA=; b=arsXv9dua82b9dta4/ALzuMKcv/xR82eMF0LISuEHcJgkCefpPE9MmRhaPMaIYJL5d T1qs8kcUgOGmByYecGKwDAX4ClkwDdNxQmJoz9hQjUlqrEK/7WFCwE37ZQSOIC9F1LAv v7S6DDW4ROpwaBvSoS16WI2m+3qnrWt3+qxg/s1OjN89BGvcMbCPu13Kz2xbRYVh4ZyP 4V7XqA+W434q+K2Peo/XR2x73SjcfIXgDtF+t+RdKF2n9ApXnUDxNGg3tPIiQYxpfrF8 ZqPBSOJ1bsAnJ1VeNkILPorayMrbBTqoM3b28OcqZUrFagf7Q/G790y+tyEOa+2/lMJ5 4ytA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j22-20020a63cf16000000b003816043f10csi794269pgg.769.2022.03.16.20.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:23:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C072E29C8B; Wed, 16 Mar 2022 20:23:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346599AbiCOJbL (ORCPT + 99 others); Tue, 15 Mar 2022 05:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346496AbiCOJbI (ORCPT ); Tue, 15 Mar 2022 05:31:08 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54DF44ECCD for ; Tue, 15 Mar 2022 02:29:56 -0700 (PDT) Received: from localhost.localdomain (ip5f5ae8f9.dynamic.kabel-deutschland.de [95.90.232.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 24C7D61EA1927; Tue, 15 Mar 2022 10:29:53 +0100 (CET) From: Paul Menzel To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: Paul Menzel , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amdgpu: Use ternary operator in `vcn_v1_0_start()` Date: Tue, 15 Mar 2022 10:29:36 +0100 Message-Id: <20220315092937.141380-1-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Remove the boilerplate of declaring a variable and using an if else statement by using the ternary operator. Signed-off-by: Paul Menzel --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 3799226defc0..78ad85fdc769 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c @@ -1095,13 +1095,8 @@ static int vcn_v1_0_start_dpg_mode(struct amdgpu_device *adev) static int vcn_v1_0_start(struct amdgpu_device *adev) { - int r; - - if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) - r = vcn_v1_0_start_dpg_mode(adev); - else - r = vcn_v1_0_start_spg_mode(adev); - return r; + return (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) ? + vcn_v1_0_start_dpg_mode(adev) : vcn_v1_0_start_spg_mode(adev); } /** -- 2.35.1