Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp895518pxj; Thu, 17 Jun 2021 16:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGh82ANj8gIvRi+KNp92ON1hFBVK9LeU19BiTMddMVTvX1TLuZSFXPAkQAQs0Nhc67x03C X-Received: by 2002:a6b:ef06:: with SMTP id k6mr5964540ioh.86.1623973786024; Thu, 17 Jun 2021 16:49:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623973786; cv=pass; d=google.com; s=arc-20160816; b=bEGLe9+m7gHzT54SSJVyJLqntH33bTVnoQDP66tnfEYMmiUpVHizMseGdqg1L8me1u zd9S5Av+fxyygNJxT0GKT3ldBMtismEO0LoPN/jO69ZEwafHBXlKIVeFpljo1TIGhO9f 0wx2vL3vWPUcz8kcmbQMiRc/HJJllTkjNktqK0/uLI9uHavSQqUArbdgOAyjsyI5ggXf CfnUfUVg3TwHjy+DbL2JdatckJ/OUPfoWtEMd1bNUAKsFJEF/odwJj9AGncV+hw/nS9w QnEtnDs++iVb9maNGWk9fFQ80k0wtqe3kdgIiy198KuGMQssVNrZLlZVkLJS7KIMkZj3 CmkQ== 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 :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=R+G8ji8N3Ie5TtSQ1lDISlZq5+SiUFbbF7n4u+Ay2Qo=; b=LCvVTjVdZ6lYpg5ujMc975kAjnULY1N7foXI84/miS1fUurcM585jVe0YUsTiQeyJk mXMNnH1bmHopVkTjh6rhPQ7CsLex4Np3lrpqhnKug+6RgX4SpcVTO/xds7Fw88g7k1oo Dz898oskWCR9d6zTut//GJYvGhSCeNohsPeZevD+GLJjAFNj+ataTDmjc8Ek2hJsDmIB 5eVgAljtwWzGqlunzzsr0zXDlpx81YAHwT4bmkFuANOMiRn8MPfFsCeFy1+toVg9Okb0 6EAzX3o8Ey7MlHYh5tG+TMCHpL3+zFkXPYu9IhbrFq+mRze3AmGTeXB+hOf5WiNNjZIm 2eKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=IOnQDLPT; 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=pass (p=QUARANTINE sp=QUARANTINE 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 r26si7059234jai.54.2021.06.17.16.49.33; Thu, 17 Jun 2021 16:49:46 -0700 (PDT) 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=@amd.com header.s=selector1 header.b=IOnQDLPT; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232270AbhFQSpI (ORCPT + 99 others); Thu, 17 Jun 2021 14:45:08 -0400 Received: from mail-bn8nam11on2049.outbound.protection.outlook.com ([40.107.236.49]:13825 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230515AbhFQSpH (ORCPT ); Thu, 17 Jun 2021 14:45:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DU5v00txmtuJ/g4cnKoro/LJZs8SzzKsX6oThUrJ0v3SKjUvVfSHLuzt3jhnE3ctBszDFfXRzP8PwhR1snpFxad6K/ssjQv9Ms3x1mGQ3iv7NleUOazuJjfi7nDN+TVZXnLBD9xK6BHpaooDdR3rku7dZv7ANKMxTdivex0EYVsQhNApADwQv2lHH7/wm4AUIddOB7SvVcrdBYYXz4pk4p8B9sUrxFJXQZE2oftiGpbYYfzdkd1VWk/V5Vde7gURwEGuUdiRAxYDehKPMUFIDPXBMyI5lX+QozvgIRAlxuMbeggDgNdk9wFkOrbk/Mr4Ze6VLq8SqBZKNU7RRz5RhQ== 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=R+G8ji8N3Ie5TtSQ1lDISlZq5+SiUFbbF7n4u+Ay2Qo=; b=DYLOnYwEti56JeGLkDw3mC57V47Eo/GXFKaXwIIa/ZVFyeAKp5dKWcdTEoIv05MkoDIGYcfgl2+DlB1FC/5F1cj4Cplewxkrmwc9ISVe33giupD/mLNozzgwrrWqkwRgx5+mbZQwanlaYQw2KWIp6qnFiVaLbRPmc+Mk/pwyrElV7XIc3c0OnHbu83UnW0OVBpYdza1sxZ+SM+XD3AYLvW34FM8eYZq82e7RfwtaO5Q+5GwO0hv0s9LFf8wuCpn8EHJ64+bVzrfsm+o8PDG8zAOx5QfxilGe7eWqvHuO5zU4MJJ+OOnbAICmqt5KVAgoaDQ7CcMkb+7oRl0OORySTQ== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R+G8ji8N3Ie5TtSQ1lDISlZq5+SiUFbbF7n4u+Ay2Qo=; b=IOnQDLPTF55ml1JGER+CuJ7WntzS2DlWt7ydIEnoKKD5HkMCdlOknlNMiOECxzDvk9LeXTzDJIPoqldW8XW16IF4yVBbGSE71RCIKMft27QXvFYGyNJ77SbADKr3DXH3ax2ZAAu2+pxr5WiQH8U68VaWONdnvORwRTS5kSxhwdM= Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=amd.com; Received: from CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) by CO6PR12MB5476.namprd12.prod.outlook.com (2603:10b6:303:138::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15; Thu, 17 Jun 2021 18:42:57 +0000 Received: from CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::401d:c7a2:6495:650b]) by CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::401d:c7a2:6495:650b%3]) with mapi id 15.20.4242.021; Thu, 17 Jun 2021 18:42:57 +0000 Subject: Re: [PATCH -next] drm/amd/display: Fix gcc unused variable warning To: Pu Lehui , sunpeng.li@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, Jun.Lei@amd.com, wenjing.liu@amd.com, Anson.Jacob@amd.com, qingqing.zhuo@amd.com, Wesley.Chalmers@amd.com, Jimmy.Kizito@amd.com, aric.cyr@amd.com, martin.tsai@amd.com, jinlong.zhang@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, zhangjinhao2@huawei.com References: <20210617023109.204591-1-pulehui@huawei.com> From: Harry Wentland Message-ID: Date: Thu, 17 Jun 2021 14:42:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 In-Reply-To: <20210617023109.204591-1-pulehui@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [198.200.67.154] X-ClientProxiedBy: QB1PR01CA0018.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:2d::31) To CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.50.3] (198.200.67.154) by QB1PR01CA0018.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:2d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 18:42:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e33c9223-13b9-4054-4711-08d931bfb9ca X-MS-TrafficTypeDiagnostic: CO6PR12MB5476: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OiFbC5H6bIZHDDw1eYDXSPQySlTMdrWwC624sJsHUfHjqB+v71uaZYhZUra0okFxWkwDJrZR2rJhckgv+/2mxmz0/W8vQcY/34scasp03mun/oGowuT2flLvhZzdYHx1Z7rctVaYS3YZQRRFD7zL7EOwmxKg/9VFpDBXMkqm0QlBZhv6qp4mXEP1LDrR8tYjZPnTk9pTMT2GMRq+5dMZTGNQSchaeFwJ68y2b9dBKio3TYQMjpklTpngoQU4bI2PkNvh+wzXJiT5pB6PJ9YR+glN0MY2gTw5thzTTgvj8wMZHSAyv1hm8tKePwWH/vAS5BB7OBmiZHGQ7hFQVM13JOAT9Vb4Six3EF6jtibBUgnFb0sMddNgBsB61gKasrrPuNuzMXFcZQfOF7r1+3ozfV7+IC8PM18DzgvNIeE58lA1OoROhAgBELjkRJEkOXD0wAV7wdMX9MKP/uGJT/+eUeMOtVH0BRTCp45WBROcS6q+sarDCmR91DufFUDk9z2tqR9aQ/auZ3O9cfD6Y3xaewf+p2hRY5zd3Ddx+CPJQCoWwDm+PY8SUJXScE2Mlfal5RuXtF5WnFtifqegPXuUqTHgLoGRjUzHIifS8gfnPF/z90OOUip2ZKW1FYMJKDjwbGu7Q5gOUn0M+Y14L4lp3Zg5stLqbSc1jfkF1fU+IRRy/u8439qXApNT3cv7rkv6L3Srki+L3tUOgG+CkIzROg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR12MB5427.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(396003)(366004)(376002)(39860400002)(2616005)(956004)(31696002)(478600001)(8676002)(26005)(5660300002)(921005)(186003)(38100700002)(36756003)(4326008)(2906002)(6636002)(44832011)(66476007)(16526019)(66556008)(53546011)(316002)(31686004)(6666004)(86362001)(6486002)(83380400001)(66946007)(16576012)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODhqZWtPWGhCZlF6MGo0cVI3YURUajN0UUVoZkhFVzlob3JCd09NM3RSUHlR?= =?utf-8?B?eXZKL01EYThKMU95aHNmRkVMTGNub1VXbXJMMDEvb1NoQTJtMXBRSWZMWGsr?= =?utf-8?B?T2s4VzNQejNvbmtrbHpTVVBjMWFITFBNSjVTRjJqWUFuZEtxWStodHNnRmRN?= =?utf-8?B?NDRiazBWWDBHK0VhUFVhdzB1RENRd1FKZGdjR0xHYmpIWDBDY2kzUkNSYVd0?= =?utf-8?B?VjZHTXhKdGdOd2RGSnY4TlpvVmtzcndjNjE3OG9aR1pKamV2MGZ3bGRGenBK?= =?utf-8?B?anUwMUh3bHNhdFhBTUF0Um16Z2IrZkFUS1QwMG1aSENBS1c1SUlEb1pQd2th?= =?utf-8?B?MWt5Q1JJSnBQWVh4WkgyMHo0OUJ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B?Rm1sRWR6REtmRUgrRWhVWXB3U21OYS8yWE5zVktRb1hSN3FWNmtraXZjaER6?= =?utf-8?B?Q05BOHFyaW9OQ2NZVndsdWlwZlFaY3FWbnBGTHgyTFVGYm5jd1J2U2M0R3RY?= =?utf-8?B?cjFXeW5kTDV6WVNoSUpVZFZIR1BUeDNTUFBPcUQrSTU5cFRxaVl3dUVPZW9T?= =?utf-8?B?MkIzN2lUYjF3VjBiYlU4TkdnQzlUQlNvNFdmME5tN0JTb2ZJYWpWRXVHZkx3?= =?utf-8?B?WFNzdy9CUHJaSmc0UUwvRm9maEExRHJ1R0pFQlNLeE0wVFB6czljbXl3RVpL?= =?utf-8?B?WXJUNlZPYkRnTVNGeURSZXVPdjYwZXV3bUpoSDlxSkhPK001VW5WTmNqcmU0?= =?utf-8?B?bnlrblVpSXR4RXQ3b1Zqb29KVCt4cTZFNzYyZnUxdTBqc0RNR05jdlNFekty?= =?utf-8?B?dHRaanV3eTBVRFVRRFFIY2lyakplTi9RT0Y5NmF4ZitLN1h3enVQUlVvOGFl?= =?utf-8?Q?+owcren1vR0g7rYEwsifFe0Z/mEUy+Hjf+urTre?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e33c9223-13b9-4054-4711-08d931bfb9ca X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5427.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 18:42:57.7830 (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: We6Zbbi91ovJidUhO5cc0MQouqBnlulgc5YzCAdtTITJuSXdqu8CmAiBM9NALmEDPk7dzL0BG8WNprvwmnpKHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5476 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-16 10:31 p.m., Pu Lehui wrote: > GCC reports the following warning with W=1: > > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:3635:17: > warning: > variable ‘status’ set but not used [-Wunused-but-set-variable] > 3635 | enum dc_status status = DC_ERROR_UNEXPECTED; > | ^~~~~~ > > The variable should be used for error check, let's fix it. > > Signed-off-by: Pu Lehui Reviewed-by: Harry Wentland Harry > --- > drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > index fcb635c85330..cf29265870c8 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > @@ -3681,6 +3681,10 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link) > DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV, > lttpr_dpcd_data, > sizeof(lttpr_dpcd_data)); > + if (status != DC_OK) { > + dm_error("%s: Read LTTPR caps data failed.\n", __func__); > + return false; > + } > > link->dpcd_caps.lttpr_caps.revision.raw = > lttpr_dpcd_data[DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV - >