Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13800744pxu; Mon, 4 Jan 2021 05:02:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeEZdGzbv6m7HSskrOWkwsNPlI1Vntb4rhGbPMVex/JL5ZquAfCTYLUIfz1SNpW5BFv7gO X-Received: by 2002:a50:ee1a:: with SMTP id g26mr16259912eds.68.1609765361777; Mon, 04 Jan 2021 05:02:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1609765361; cv=pass; d=google.com; s=arc-20160816; b=YWc2emk3arX+Q5LBH2duMYFVZ2Ky2HxD36dortfigSs3UrnygmIhN1muNxCrOoE/tg jeI1uiUQVs7yzqStJlh4WeOmRf8WMStC8/A15+ZCFqkEa3riUX8WCGtIBg8QOuMXEP14 Zl+gYqUHjFX5CXJlneyNBNRXYiPhjVVHRcU+6SagmDprgsSLSmADslXagrpp8tZS2RfA NMSjiW97x1RhsGOw174U8ybJcJkXKtqPwlphh986fdf6f4yBFmSOJ4PExaot7c6OOKGA iwQUVxccjLcHr+yD7rI/y3l5tBoTMWZYlyID5+bUDac1bpJfXE2pgps63g8lmhVgf5qV MLsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=gaJXmyM2Ry20MMOZkhYz0Uc1PtUHYT6Bw3PURcU15Zw=; b=zcO0PutsYGsXptsmlQQ6ZlLlEuxu7NJKYjN0GRbSYeZNK+9W+HXAPLOy0reeomGyvR 4t662a8Hp9uvAE8NO9sg4BZ8c17Z66v1JDFNQQblueQdDhpIqWWCBxDv0HqZKgnXtMKm tpk/M/luyiHzT4uNr3TnQDN6WCeZMhSao+eUr75dkqQwKu51Hdt9ri98aXiUdnWJpEuy +gN9VsVazTGc5Sk9bn/hmwkuFqfitScabmLRuJ1NnxlEEy+rI+0U+TC4gDTlNb928/Jq m5o3ZIw+Aqf3Ourmee4RxHGjRpoWsWqmqnLS4FatLqKi8s4TCA16SiD6oGoL9h494yh3 zkKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=QjagjMhB; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si30857170edr.527.2021.01.04.05.02.18; Mon, 04 Jan 2021 05:02:41 -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=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=QjagjMhB; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbhADM67 (ORCPT + 99 others); Mon, 4 Jan 2021 07:58:59 -0500 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:6880 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725840AbhADM66 (ORCPT ); Mon, 4 Jan 2021 07:58:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NM1X5+8RLoqvDbNIu7H+uXlc13OBxxSCSAVxnTeNbOMBHQnQcktWmBTQs8/f7ZyWXnElHE2PPv9HCNssrraz34zqjJnWZOV94iZO5Cz8t2M+K4pAIwx/zHk9qfnDt3wECGGoTDHO1T7A6lIsumS0IZjcSqtB8wmggezZ2gHQY9419lp0vEVT3S9Bc5MrZkCiVIWiOSY9+Z0E3OsO8S6pfKAPTfvrQenoyr5lvgeNdVbTxUu7MK7VPjq1ZmpiiZpUSYJbwDWz5hBZv8xKwmGRjv39aK6J9tEyfDl0ZgT3wet1g9pEFm8RxajtqrcaV7zU97EwNdq7IVcGsYVMlbTm2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gaJXmyM2Ry20MMOZkhYz0Uc1PtUHYT6Bw3PURcU15Zw=; b=V4zMqJsCbsN8edUWd/h/Cl11hawRxkUqOF715/N6ltTPGljvx7wRPA9+e+xTViT9ssfpKnbiXA+5JIpqkeQKbhbagVggvgkhTqXPiko7lDGYZhZlh+rmqG6T0iKVCmOfJ9e6qfQk0/GCfHVuKeujR2w9CrTpKhXK5+neItaOdHlwhN62gj8Zxc+QaYzvuW4IJaRAaqV6sZm0FhlXMHvAtv23QcNHMM0MkU9sxbHsulOzjSZzYkGECe/3NQF39lCYhJONbnqwAWoAQpM77vW9Kitw66L/ZG2eRTniRBSfeMHW1PCNLpIje+5Wjli9ODOgZa5MDDUjBxa9uPC4+D7grw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gaJXmyM2Ry20MMOZkhYz0Uc1PtUHYT6Bw3PURcU15Zw=; b=QjagjMhBoQ3QS6IS/KtS0DG3eWUrzX5od1GTq1nxKrnLLTPnWMNzLKDRIT71sdEsv2MmQC+J5fsDdpg7/SinqvI0UG9314KWoIzq9ipITp/MFc+PliCNbnFD9OJdaYLfybZxvJblxP4UtTo0qNfBhMZFhkjmM8iJZX3r3CjTkZ8= Received: from BN8PR12MB4770.namprd12.prod.outlook.com (2603:10b6:408:a1::30) by BN7PR12MB2593.namprd12.prod.outlook.com (2603:10b6:408:25::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Mon, 4 Jan 2021 12:58:00 +0000 Received: from BN8PR12MB4770.namprd12.prod.outlook.com ([fe80::a440:d0d:9875:252]) by BN8PR12MB4770.namprd12.prod.outlook.com ([fe80::a440:d0d:9875:252%6]) with mapi id 15.20.3721.024; Mon, 4 Jan 2021 12:58:00 +0000 From: "Lin, Wayne" To: Arnd Bergmann , "Wentland, Harry" , "Li, Sun peng (Leo)" , "Deucher, Alexander" , "Koenig, Christian" , David Airlie , Daniel Vetter , "R, Bindu" CC: Arnd Bergmann , "Kazlauskas, Nicholas" , "Siqueira, Rodrigo" , "Pillai, Aurabindo" , "Wang, Chao-kai (Stylon)" , Simon Ser , "Brol, Eryk" , Bas Nieuwenhuizen , "Lakha, Bhawanpreet" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] drm/amd/display: Fix unused variable warning Thread-Topic: [PATCH] drm/amd/display: Fix unused variable warning Thread-Index: AQHW4dkkpTQdEwPNtE2e5OslrfcQZqoXbUZA Date: Mon, 4 Jan 2021 12:58:00 +0000 Message-ID: References: <20210103140248.3889757-1-arnd@kernel.org> In-Reply-To: <20210103140248.3889757-1-arnd@kernel.org> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ActionId=e13ab4c6-ac6b-45c2-8c2d-c33fd7128f5d;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=0;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=true;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Use Only - Unrestricted;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2021-01-04T12:52:40Z;MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=amd.com; x-originating-ip: [36.238.154.142] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9c5ed789-1d4d-4569-cbe5-08d8b0b05da9 x-ms-traffictypediagnostic: BN7PR12MB2593: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:800; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LVzjsq2BSm3dA4L5bhBVg1TiNZD5thjMUnzHPE5ti+E1Yp46/77N3iZClknblXbMcnuNw+moMq+RohupnGiRLtzhsF/DVWX/XvCsa2UgOgZT8lFHyTZ4GAOiwFzojea983YzVROOmeHcrYlX51PzDvLoo34K1sELE+fqDmmqlZ0oW5xEvRQ1taDLZ/lzT0tvFgbDCqt0PlFJ9Hrh0HwuYsymAfOUV6CLuFB89OawP70SONRs4UG7GoMHVgwcptFAdHOGbAD2nUB6+I7VTB7Db6necnSOHt9CCIeE13Z9/wZ2tq4Ire9DRKAfnw6+WkMpeVrpOGBXgNhrjLSbM+C4sAW18iNMU0/3dtAga/jXDbKArdKOkqeYbRmSPRgtsg4/+hBjezFdToFmBFuC4X1v3xunbapYlMlPiom7dTwTGQ1bwh9PwHlU4smrDUGlUoZk x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB4770.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(396003)(346002)(366004)(136003)(316002)(186003)(921005)(5660300002)(86362001)(64756008)(8936002)(71200400001)(6506007)(478600001)(2906002)(66446008)(8676002)(110136005)(66476007)(66556008)(66946007)(76116006)(54906003)(55016002)(6636002)(52536014)(83380400001)(33656002)(4326008)(7696005)(53546011)(9686003)(26005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?mgxun+rV4A7UASJmVDwRAgbMIaxYszlyQx3TeUe+oSWmCWUvSbOvGSZCMp26?= =?us-ascii?Q?BQOmBai6xZ6KvcJwVATu/QsqyolSU5jalFhpwfyBB6tP6QiWGBTFpjjCd7AV?= =?us-ascii?Q?Pb0L48wHGZb4PfuJK13TCSd/QNakYd6hlk6T1hhNFTDLNxARovgdy1LfM7rV?= =?us-ascii?Q?RubrImyReSLP+MYj984wFD+9NqyZU5uh8yx6Ey7erdb34LuH3wNjJ3jX3ppa?= =?us-ascii?Q?Ca2SPJyTGB9S09f3oz0XTj50+oSNB4Klzkc5Z3HaS7QnJ0TY5beL0MgdBDM0?= =?us-ascii?Q?mt4tmTpdfuTIjS8a+6JBpQrtf3pyQsRkPPoMqMPg/TVFQjlLJHt4K37gJ5rZ?= =?us-ascii?Q?jL61Z15hV4D8MHRbC6QzAVgGYRQ9Zhz1bP3KwcW/lGMdPJSNiqIhutjRN01y?= =?us-ascii?Q?lTyKsxeTzg+dlLKvydzjb1NQvGwgnCFnmfaQ6fmGOt5TSiMIU1ft1xmQTXII?= =?us-ascii?Q?j3+l9w7dS6kLrbkidGpltsszbOWab0CV2RKvW/rc3gZHivXAcJb++MqX2Fxv?= =?us-ascii?Q?+VSBUIH5r1sdB7vp34mzNuEnHdXpyUCs8UpPInum8V1rNZN0b/ddXJBvu3JD?= =?us-ascii?Q?i3Guqo0K7DefBJqQeemRk3bySCExb1C7NhJerLNdZRPOmeKJmqNnThobbpAT?= =?us-ascii?Q?TCn2UEklHvbs/p6bdO/szY3X11r6A5j/iT9vN8lyGmDBbkijzNXM2jKQvn+x?= =?us-ascii?Q?uAvH4gedO4XOL4dl+9rHAHQ7Df8CE0nSpaZ7bqvM521uEYF9svD5XqtbCfQv?= =?us-ascii?Q?5QZdCIcWFPxlCMjSEb/zxKRFvQyZrCXAsG5J1OTvkV1RoQVtiXIcBosGESGz?= =?us-ascii?Q?e3y4aCHeQrZ0aTjR6lBIt6mzOfSsQ6kQqHDlh9YZatBtXJLSv9paMgKJ25Dw?= =?us-ascii?Q?CSXFY4+Bma+kCc1eJLAsUVas+hjbKHuPWGlaOKmQazvVY3NoGXknGL2N/Mnn?= =?us-ascii?Q?VPl8hKHxsvBdvfInjatIaSSnivjx0de84yHvXPfRynk=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB4770.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c5ed789-1d4d-4569-cbe5-08d8b0b05da9 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2021 12:58:00.3407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cKysLRTPo3sYsIVhsrJuPBHNCkC8U6qb5vYRR6KBMwerhIol9Pu7pGG404VRdmPrrIOdOdoUjyYf8/q7gl/cjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2593 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [AMD Official Use Only - Internal Distribution Only] Thanks Arnd. Reviewed-by: Wayne Lin -----Original Message----- From: Arnd Bergmann Sent: Sunday, January 3, 2021 10:03 PM To: Wentland, Harry ; Li, Sun peng (Leo) ; Deucher, Alexander ; Koenig, Christi= an ; David Airlie ; Daniel Vett= er ; R, Bindu ; Lin, Wayne Cc: Arnd Bergmann ; Kazlauskas, Nicholas ; Siqueira, Rodrigo ; Pillai, Aurabindo= ; Wang, Chao-kai (Stylon) ;= Simon Ser ; Brol, Eryk ; Bas Nieuw= enhuizen ; Lakha, Bhawanpreet ; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: Fix unused variable warning From: Arnd Bergmann Some of the newly added code is hidden inside of #ifdef blocks, but one var= iable 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/gp= u/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_a= tomic_state *state) acrtc->dm_irq_params.stream =3D 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/dr= ivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h b/drivers/gpu/drm/amd/d= isplay/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 a= mdgpu_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_cr= c_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_n= ame); int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name, -- 2.29.2