Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13248552pxu; Sun, 3 Jan 2021 07:31:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaKQdbTofMb9BkR4ZpaWYhvwxlae+u+Y0t47b18XlGzZsAATeLZH8UOBhrEmJG9L2CzE+e X-Received: by 2002:a17:906:a192:: with SMTP id s18mr61022471ejy.249.1609687916285; Sun, 03 Jan 2021 07:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609687916; cv=none; d=google.com; s=arc-20160816; b=mS8CHE31nRPV45gfPr+bWn1B4JnjI3QbgBlMy+fWd67b2iD4zjphZyfTQNmw6K6Kk2 cRRtinl8FR7O/bRkGPPVvh2FxefZapGHpmVD1hmcPf4VJEf4yR/GIMaUFBvLTVPlw/0z bNGz2CRfOUR6Sug8M5d3cfD39xhkJQVyxtsnixpyYpMlvbCuMrjRJMAfpG9jI6qJ0+L9 JO/iTl0TAmLvxpAEVl6abiayzIc6GLAfJv6NcZvVT6BXQ7ePdjvozWNyeki9Qyi3R136 x0UsZKlJBBwyeOilobAnF7bTtB4GUkMdj6cTOeiUgyc9+/nfZ88/kV/q33e5DmHbvXz0 Z+2w== 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=A9VzKM9zIKMvSz8cobc2H2Hf+cqqpxGlV3nZKRPFPVE=; b=OsxPW0/VFy5uEhe8XsfqEB0odpC+dyShlGOwqyIYL0xb0qz+pwLppyiK/dzyu12Jzd Lme6OdtLf0Ba8q7acPkfbpAUwtLR4YqluIyezCiyQs4YKHeUUN4Tr4mHoG2v+LpBexgE hMlI9ptlUuBlzfFww0zz5PfH4q16FTyUbEvjj8tGUguykjFZA/qIP6oOKITnyY7jFXKO yNz1W+2YYv1818+40HNWQEnmpgq7FEmWw/c5aAnM26Inyuq1yI+jP4Iwf4BfrrvVHcrN ygFeqg1bFMcMxZfs80yEFSMJRTtbMyq+DRVhPDlOVs+M7GodJVcuxXhydEQdYTeTe+Em SISw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pAcDoGwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id am1si26247542ejc.463.2021.01.03.07.31.32; Sun, 03 Jan 2021 07:31:56 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pAcDoGwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727187AbhACODf (ORCPT + 99 others); Sun, 3 Jan 2021 09:03:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:35872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbhACODe (ORCPT ); Sun, 3 Jan 2021 09:03:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB6C820C56; Sun, 3 Jan 2021 14:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609682574; bh=3wcwLP3yhCppf7CmmfZnT9BbP/bxX1BDeFfoAgZD7GE=; h=From:To:Cc:Subject:Date:From; b=pAcDoGwXTxoLbRuqvjDyDS6otLikwiQMDcc3fODKiZNBVIdSURyBviZh5tjSDBF7K 8xAOo8d1cVGR7vuCXkZUcfCyTizilb85We8xUkiUFv6t/3oMo4glpbw0LjBjEP1vbg /OWW88tRwdwjKHP2GfXw+VRZRY10ez255oYI5FDenFjeDttG5i4nOSbwA360HT4PAt +xow4n7CekvVVnSCNER28TiCrgt4dkUGQ9jwSo38efPSG0oc8cO52X4dNMSFLPz9az eb8lxL2Zet+qUcrEhqu56CajDJWzrMxzJBopLdACrm7w8w9cpIsblvSPO7FZGSOwPX rWht1Y+bvN3Vw== From: Arnd Bergmann To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , Bindu Ramamurthy , Wayne Lin Cc: Arnd Bergmann , Nicholas Kazlauskas , Rodrigo Siqueira , Aurabindo Pillai , Stylon Wang , Simon Ser , Eryk Brol , Bas Nieuwenhuizen , Bhawanpreet Lakha , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: Fix unused variable warning Date: Sun, 3 Jan 2021 15:02:32 +0100 Message-Id: <20210103140248.3889757-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Some of the newly added code is hidden inside of #ifdef blocks, but one variable is unused when debugfs is disabled: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8370:8: error: unused variable 'configure_crc' [-Werror,-Wunused-variable] Change the #ifdef to an if(IS_ENABLED()) check to fix the warning and avoid adding more #ifdefs. Fixes: c920888c604d ("drm/amd/display: Expose new CRC window property") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 42b0fdb72e7b..5071b55ad0f6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8379,8 +8379,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) acrtc->dm_irq_params.stream = dm_new_crtc_state->stream; manage_dm_interrupts(adev, acrtc, true); } -#ifdef CONFIG_DEBUG_FS - if (new_crtc_state->active && + if (IS_ENABLED(CONFIG_DEBUG_FS) && new_crtc_state->active && amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) { /** * Frontend may have changed so reapply the CRC capture @@ -8401,7 +8400,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) amdgpu_dm_crtc_configure_crc_source( crtc, dm_new_crtc_state, dm_new_crtc_state->crc_src); } -#endif } for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h index 0235bfb246e5..eba2f1d35d07 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h @@ -46,13 +46,13 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum amdgpu_dm_pipe_crc_source } /* amdgpu_dm_crc.c */ -#ifdef CONFIG_DEBUG_FS bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state); bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state, struct dm_crtc_state *dm_old_crtc_state); int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, struct dm_crtc_state *dm_crtc_state, enum amdgpu_dm_pipe_crc_source source); +#ifdef CONFIG_DEBUG_FS int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name); int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name, -- 2.29.2