From patchwork Wed Mar 8 14:10:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 66268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp374612wrd; Wed, 8 Mar 2023 06:44:02 -0800 (PST) X-Google-Smtp-Source: AK7set/ZcMhzbQUGzN0JpWE0EuSQ/2WHMaOMWPDy5kYUAhVyi6JtGisTk8Od6GBxEARh8PZclZd6 X-Received: by 2002:a17:902:8683:b0:19b:107b:698e with SMTP id g3-20020a170902868300b0019b107b698emr15248788plo.14.1678286642163; Wed, 08 Mar 2023 06:44:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678286642; cv=none; d=google.com; s=arc-20160816; b=eRjR7gRCrkOy+0g8ckKZhit83y3fGxgkVEUxBdqoqBNjEUhGEkPZog9VFgObCsVasf 55G9tA9/GdVkqawibcaB5QlFtj13UgdmzsC7LHBU86VtIBdpj1CJUYNo+Dt8FcCBPpRs saomlQ8lGN1gIBWmzyvjiC7Plaorht5xxvfPCHLtH8qxdyMyvkGfIdpR7n8TsLHoKkpn fO2WYl1VubiK9lpF4VnjWq4RUl1WHAcrRJF32Us8Bgjy2Ck0owPWaRtKuj/QUuZOCjnu j2vS8pk+GtPuhIjrH3CoUJT4v8mIwQBlYOjwQHEM62Ou9MQ1/rUAkyK/SEtKvnt0f+cA t4aA== 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=m81gFkR2y1XD7ZSB1IHW7cdgZ+75l9heGqDR7NPaKd4=; b=g/9K6lD3Tr8bsC2KIuE9E0xfL/4PQEtdtLGy7XRUVOSAO3rvdn1szWUyazru2xL+3l 7ruTLz7IdgH+XqHx1MdhzV4kK5+RFky0C4u2M8AmHNFQSdqbsDnJF9094Gbz/NeqtAas eYdFK+w299dLht2DDsjN4KLDNKqoyLCHfAtsXaYo22dt7IzG+2UzEZJrXSowedzaeD9y LWKi08icEgVRpkjs/mcEofTO7KoqAxcYNQiUpUxdrFU+i7IBhh4iOFz2eq1IVQ4kceEd wE9/GBlfo56GaNGUUgoST2qmnswrbMvfKyycf+8tuPcN9fQa8oXWim5SV/9L51SVoxiB HXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ss13AnDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a170902ebd000b001948d9c2ca8si13819424plg.179.2023.03.08.06.43.48; Wed, 08 Mar 2023 06:44:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ss13AnDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230155AbjCHONe (ORCPT + 99 others); Wed, 8 Mar 2023 09:13:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbjCHONL (ORCPT ); Wed, 8 Mar 2023 09:13:11 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDB668ABF8 for ; Wed, 8 Mar 2023 06:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678284693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m81gFkR2y1XD7ZSB1IHW7cdgZ+75l9heGqDR7NPaKd4=; b=Ss13AnDnjQpHBSwXG+gGs4fD3AcaMUzMikIZ9IRRmu4ZCwp1H5IVJGiHrUvCByddJfW1A3 CRlt5qRzOBKR6OCHgZAF3Pq3Y/0p33usQuUpVd7nSZWj26oPmbnZY6Y8Mg0AepULWi5mKH RcPvRQtPFsERSyKmdcrM3vn9QpV1yRo= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-597-OKjgDrh3NUOnlgU19nYimA-1; Wed, 08 Mar 2023 09:11:25 -0500 X-MC-Unique: OKjgDrh3NUOnlgU19nYimA-1 Received: by mail-qk1-f199.google.com with SMTP id z23-20020a376517000000b00731b7a45b7fso9486934qkb.2 for ; Wed, 08 Mar 2023 06:11:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678284684; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m81gFkR2y1XD7ZSB1IHW7cdgZ+75l9heGqDR7NPaKd4=; b=1sSnmUopaCrMTlE2+Ei4C+hS0k596x/r1+16PfgE7uzcc5TyhLoW7cGVctBoUA9+1h GzMOSHIwcvoje4KsaY1qqhv/CFnshsdoLLTVB6XAGgNB5+wPW0OFseM8UUyIuMPSfj1Z YkkZdIjxQimEUYYXNlpIg9jo6iuQeEoK+FSMXKk3piR0XqCdaB8lyx8REsjeQigqMMhD sNiK4nEJJQomSwIj2XMrp0jn5D60khBVu7wadca2r1dGg0y2CVW8b+tckQkhb6bIUxyf TcLr6PoX1nQIZqsFywfowp6ots9QasyedpYZlr+/dR48C0I33yi2ssKufJaeWcl3kAr5 3ehQ== X-Gm-Message-State: AO0yUKWvdhiOUln7Hvz5ONAYJJafydAow+TNd2DjHyOk88iJNVzAXV32 uCZqU2PTOobMbdsTlXmYNOwN1wSqusK7hlGV+xwxRUKNMPHURLVQo7TO4EMx5HTRVqhI0lwgxhB pT975VrE0kFV1vWNuQhobIg+j X-Received: by 2002:a05:6214:202d:b0:572:6ed8:e494 with SMTP id 13-20020a056214202d00b005726ed8e494mr36527165qvf.18.1678284684064; Wed, 08 Mar 2023 06:11:24 -0800 (PST) X-Received: by 2002:a05:6214:202d:b0:572:6ed8:e494 with SMTP id 13-20020a056214202d00b005726ed8e494mr36527115qvf.18.1678284683835; Wed, 08 Mar 2023 06:11:23 -0800 (PST) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id q79-20020a374352000000b0073b27323c6dsm11187764qka.136.2023.03.08.06.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 06:11:23 -0800 (PST) From: Tom Rix To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, wenjing.liu@amd.com, qingqing.zhuo@amd.com, Jun.Lei@amd.com, mghaddar@amd.com, candice.li@amd.com, aric.cyr@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH] drm/amd/display: remove unused variable available Date: Wed, 8 Mar 2023 09:10:57 -0500 Message-Id: <20230308141057.2010361-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759811094058980931?= X-GMAIL-MSGID: =?utf-8?q?1759811094058980931?= With gcc and W=1, there is this error drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_dpia_bw.c:297:13: error: variable ‘available’ set but not used [-Werror=unused-but-set-variable] 297 | int available = 0; | ^~~~~~~~~ Since available is unused, remove it. Signed-off-by: Tom Rix --- .../drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c index f14217cc16fd..2f0311c42f90 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c @@ -294,7 +294,6 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) void dpia_handle_bw_alloc_response(struct dc_link *link, uint8_t bw, uint8_t result) { int bw_needed = 0; - int available = 0; int estimated = 0; int host_router_total_estimated_bw = 0; @@ -373,20 +372,13 @@ void dpia_handle_bw_alloc_response(struct dc_link *link, uint8_t bw, uint8_t res // 1. If due to unplug of other sink if (estimated == host_router_total_estimated_bw) { - // First update the estimated & max_bw fields if (link->dpia_bw_alloc_config.estimated_bw < estimated) { - available = estimated - link->dpia_bw_alloc_config.estimated_bw; link->dpia_bw_alloc_config.estimated_bw = estimated; } } // 2. If due to realloc bw btw 2 dpia due to plug OR realloc unused Bw else { - - // We took from another unplugged/problematic sink to give to us - if (link->dpia_bw_alloc_config.estimated_bw < estimated) - available = estimated - link->dpia_bw_alloc_config.estimated_bw; - // We lost estimated bw usually due to plug event of other dpia link->dpia_bw_alloc_config.estimated_bw = estimated; }