From patchwork Sun Jan 3 14:02:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 356151 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp14272273jai; Sun, 3 Jan 2021 06:02:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPvc0nOlsW88/wwwHEFTbJiYgFCJSvE1kXZ62/fSa3fPGhWBakA4u9I/UfIh9KIaNJQdyW X-Received: by 2002:a17:902:7e85:b029:da:72a2:de1 with SMTP id z5-20020a1709027e85b02900da72a20de1mr68051233pla.57.1609682579082; Sun, 03 Jan 2021 06:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609682579; cv=none; d=google.com; s=arc-20160816; b=tqnXkFRCWXPXBMccCxZxWeRhDm1d70u+Q41wnwmjv3EfF97T0Q2A+odPbA9J4BBN9X 0RZLDuwbKSuzN1X/frRxOpvnQPsolMIbdQ4Ed3zC6f5xcvtH4nDoN60L1uHL/RWVWY5E zGCs51tHCGCdr+sx1zdNC/jaJmUsQuP8Aagpn54hztnr2fxawr5rnJHVdoFMWcW63aFe JX3KjXbnhaJKLtXm86fUrK8fOZ65kUnmwSD+BndQfcsJey2wYvXbw3NEbxzRWnyaIIBH oZWBwy54wtsT6NkL3P4oF1avRs5DrKqDzqNila/OzzB3njm/Fxuv7uQpgBuYdXAi2kY7 tjqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=9Axkwl2QavZKZyuzJb+/keFdgYSCFiHNCr+ImVc7cWg=; b=NBftPoanzNCdHc2jBf9n+kjDodTn/rBIbX8Mzbo4L6257IcP/vGJX7zE04nyq+B98x l1Mj0CwC2SioN3icv2mHDP3sMTiUVxua+84AsEVyLDPIctYZD+J9Cj5wsQ1oH+Yb6pCC y3gcN2hWrxyRmPKQl6gOnyp4rwrcKmmq5PKCz0aKFKoD52zBKAiQMw+P+ozu/NUQ9hfX uovKjkf0rxQ4Fh4Ft8WzHeJadZMIh5xC8BvCXTpeTwlpqf74HVVN2W1WSov8taF2PpUD EAWPImAHE1d+nKG9+lbtHYXS0sBIEln61Df0qMxXofyzJ6H+u/s3grks2WRsxHx0Kr6d rsKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=pAcDoGwX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id d9si53433586plj.354.2021.01.03.06.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 06:02:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=pAcDoGwX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B39E089623; Sun, 3 Jan 2021 14:02:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A92F89623 for ; Sun, 3 Jan 2021 14:02:54 +0000 (UTC) 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_K=C3=B6?= =?utf-8?q?nig?= , David Airlie , Daniel Vetter , Bindu Ramamurthy , Wayne Lin 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stylon Wang , Eryk Brol , Arnd Bergmann , Rodrigo Siqueira , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Aurabindo Pillai , Bhawanpreet Lakha , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Wayne Lin Signed-off-by: Arnd Bergmann 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,