Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp484547ybc; Tue, 12 Nov 2019 04:43:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxIeO8DXz1Qs2BefNllyua3UK+WtPxihM00PxjCo4OFUp3nV0lNsPZo7KLnF2+qmIHhpf2k X-Received: by 2002:a17:906:af5a:: with SMTP id ly26mr26811056ejb.252.1573562594497; Tue, 12 Nov 2019 04:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573562594; cv=none; d=google.com; s=arc-20160816; b=wk/8QTDaQML/IvaXFURFostcGh1YiG8JDLv2WQmCyWgXS6CD1PbC+Z9qE0i3qUAODz bMWo3xroJyWR1gbloTHfDwEP5rz2+Z/pGvbcWEtr5Cw4ubu9MygoQdPvwdjnRnRBC0Xz ilxgLmgdITBmYSRqT5o+uLCrDEYSZeNOVwVqMrAkIUTZgTROCFaeuvR/f2lA17uUWXbl 9Pq1EFnz9H6J/LvuNlvRTcGrsQp1jsiMZjTW4ENk4jw55jjOjbeCU8q2QjOZ1I6CNm+E zLiHfDSYz+002t/jdU4f6QuL4W9kRTvmwv/8VO5lQ42upztciX0wVMsnQ90QG6RUm3HT sMRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Z4CoM3ku94+ac0RmSl7bZ2+Xnh1lqmABnTlguTHB2Tk=; b=l1QLGiatba5J8jmjksXNcYntpQsMRUD3S8nNjDn97RC3bqOmO6D2bFZ85F/kI+GE8x TU/xhNhaEPB9Le3H379PWLYDxcvbYgOQ2EcsyeghTL9c56nMgE7kNUSyqwI2x/pGeWVM CTvgzncTQcZggUGjAhm8INfqp5hVr4glkLmC6t9QFdC3peBzkHqsNa1nfUlo4kBluaB8 HsQCxhpv/iz6Zhvy9bcfEMV7JHszP5HHZAhseNILIoDKJY69vI7u7ANj2ndbLxVyUpTM AOjTxLoYwynbM9c/bgOuN+WXTJF1QTOprQhxabOAPULighKD2OnXml/hjqVHVs2olWmF Vo2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=RcgoZxq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si11476663eja.67.2019.11.12.04.42.49; Tue, 12 Nov 2019 04:43:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=RcgoZxq9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbfKLMj6 (ORCPT + 99 others); Tue, 12 Nov 2019 07:39:58 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:56672 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfKLMj5 (ORCPT ); Tue, 12 Nov 2019 07:39:57 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xACCbu45029985; Tue, 12 Nov 2019 13:39:42 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=Z4CoM3ku94+ac0RmSl7bZ2+Xnh1lqmABnTlguTHB2Tk=; b=RcgoZxq9ErDSnyY+sdoz5jplgk1LzlR9uF7Snh9sVSmCNv1PAtMM5OUaf29+O/16lTW9 nibQNiqxwnO3CvszwR6LPeRWLFOOLoj3x4pCnyJmO5iEEX0VBT6/+wGzDNL0rrIQIARP t2+vWBcm2L8IPCsjtlPj1N56z3hna7w/7KPngApzEcubU/BTpeFbz5UFY+6qHRsibnL6 tVObUiYMRJy7ekVJ/X5ZdqdAaedvCQ8ub4IR8ke/hDQYoJ/L0km1tHb6da13zXKDeZhA S8s+sNvUeBjPhNopoZFtxP2admeAQbhfEeJFbLdzz5xT3Ln1ebnEkPOpYT6L8OoZuEz7 uw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2w7psjj3cf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Nov 2019 13:39:42 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A58D610002A; Tue, 12 Nov 2019 13:39:40 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4FD742BC7BB; Tue, 12 Nov 2019 13:39:40 +0100 (CET) Received: from localhost (10.75.127.44) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 12 Nov 2019 13:39:39 +0100 From: Benjamin Gaignard To: , , , , CC: , , Benjamin Gaignard Subject: [PATCH] drm/dp_mst: Fix W=1 warnings Date: Tue, 12 Nov 2019 13:39:38 +0100 Message-ID: <20191112123938.2346-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG3NODE3.st.com (10.75.127.9) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-12_03:2019-11-11,2019-11-12 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the warnings that show up with W=1. They are all about unused but set variables. Signed-off-by: Benjamin Gaignard --- drivers/gpu/drm/drm_dp_mst_topology.c | 50 +++++++++++++---------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index b854a422a523..6ff554be8000 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -672,7 +672,6 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, u8 *replybuf, u8 replybuflen, bool hdr) { int ret; - u8 crc4; if (hdr) { u8 hdrlen; @@ -714,8 +713,6 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, } if (msg->curchunk_idx >= msg->curchunk_len) { - /* do CRC */ - crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1); /* copy chunk into bigger msg */ memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1); msg->curlen += msg->curchunk_len - 1; @@ -1744,14 +1741,13 @@ static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port, */ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port) { - int ret; u8 rad[6], lct; bool send_link = false; switch (port->pdt) { case DP_PEER_DEVICE_DP_LEGACY_CONV: case DP_PEER_DEVICE_SST_SINK: /* add i2c over sideband */ - ret = drm_dp_mst_register_i2c_bus(&port->aux); + drm_dp_mst_register_i2c_bus(&port->aux); break; case DP_PEER_DEVICE_MST_BRANCHING: lct = drm_dp_calculate_rad(port, rad); @@ -1821,21 +1817,18 @@ ssize_t drm_dp_mst_dpcd_write(struct drm_dp_aux *aux, static void drm_dp_check_mstb_guid(struct drm_dp_mst_branch *mstb, u8 *guid) { - int ret; - memcpy(mstb->guid, guid, 16); if (!drm_dp_validate_guid(mstb->mgr, mstb->guid)) { if (mstb->port_parent) { - ret = drm_dp_send_dpcd_write( + drm_dp_send_dpcd_write( mstb->mgr, mstb->port_parent, DP_GUID, 16, mstb->guid); } else { - - ret = drm_dp_dpcd_write( + drm_dp_dpcd_write( mstb->mgr->aux, DP_GUID, mstb->guid, @@ -2427,14 +2420,14 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, { struct drm_dp_sideband_msg_tx *txmsg; struct drm_dp_link_address_ack_reply *reply; - int i, len, ret; + int i, ret; txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); if (!txmsg) return; txmsg->dst = mstb; - len = build_link_address(txmsg); + build_link_address(txmsg); mstb->link_address_sent = true; drm_dp_queue_down_tx(mgr, txmsg); @@ -2476,7 +2469,6 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, { struct drm_dp_enum_path_resources_ack_reply *path_res; struct drm_dp_sideband_msg_tx *txmsg; - int len; int ret; txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); @@ -2484,7 +2476,7 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, return -ENOMEM; txmsg->dst = mstb; - len = build_enum_path_resources(txmsg, port->port_num); + build_enum_path_resources(txmsg, port->port_num); drm_dp_queue_down_tx(mgr, txmsg); @@ -2567,7 +2559,7 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, { struct drm_dp_sideband_msg_tx *txmsg; struct drm_dp_mst_branch *mstb; - int len, ret, port_num; + int ret, port_num; u8 sinks[DRM_DP_MAX_SDP_STREAMS]; int i; @@ -2592,9 +2584,9 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, sinks[i] = i; txmsg->dst = mstb; - len = build_allocate_payload(txmsg, port_num, - id, - pbn, port->num_sdp_streams, sinks); + build_allocate_payload(txmsg, port_num, + id, + pbn, port->num_sdp_streams, sinks); drm_dp_queue_down_tx(mgr, txmsg); @@ -2623,7 +2615,7 @@ int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, bool power_up) { struct drm_dp_sideband_msg_tx *txmsg; - int len, ret; + int ret; port = drm_dp_mst_topology_get_port_validated(mgr, port); if (!port) @@ -2636,7 +2628,7 @@ int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr, } txmsg->dst = port->parent; - len = build_power_updown_phy(txmsg, port->port_num, power_up); + build_power_updown_phy(txmsg, port->port_num, power_up); drm_dp_queue_down_tx(mgr, txmsg); ret = drm_dp_mst_wait_tx_reply(port->parent, txmsg); @@ -2856,7 +2848,6 @@ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes) { - int len; int ret = 0; struct drm_dp_sideband_msg_tx *txmsg; struct drm_dp_mst_branch *mstb; @@ -2871,7 +2862,7 @@ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, goto fail_put; } - len = build_dpcd_read(txmsg, port->port_num, offset, size); + build_dpcd_read(txmsg, port->port_num, offset, size); txmsg->dst = port->parent; drm_dp_queue_down_tx(mgr, txmsg); @@ -2909,7 +2900,6 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes) { - int len; int ret; struct drm_dp_sideband_msg_tx *txmsg; struct drm_dp_mst_branch *mstb; @@ -2924,7 +2914,7 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, goto fail_put; } - len = build_dpcd_write(txmsg, port->port_num, offset, size, bytes); + build_dpcd_write(txmsg, port->port_num, offset, size, bytes); txmsg->dst = mstb; drm_dp_queue_down_tx(mgr, txmsg); @@ -3147,7 +3137,7 @@ static bool drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up) { int len; u8 replyblock[32]; - int replylen, origlen, curreply; + int replylen, curreply; int ret; struct drm_dp_sideband_msg_rx *msg; int basereg = up ? DP_SIDEBAND_MSG_UP_REQ_BASE : DP_SIDEBAND_MSG_DOWN_REP_BASE; @@ -3167,7 +3157,6 @@ static bool drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up) } replylen = msg->curchunk_len + msg->curchunk_hdrlen; - origlen = replylen; replylen -= len; curreply = len; while (replylen > 0) { @@ -3959,17 +3948,16 @@ void drm_dp_mst_dump_topology(struct seq_file *m, mutex_lock(&mgr->lock); if (mgr->mst_primary) { u8 buf[DP_PAYLOAD_TABLE_SIZE]; - int ret; - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); + drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); seq_printf(m, "dpcd: %*ph\n", DP_RECEIVER_CAP_SIZE, buf); - ret = drm_dp_dpcd_read(mgr->aux, DP_FAUX_CAP, buf, 2); + drm_dp_dpcd_read(mgr->aux, DP_FAUX_CAP, buf, 2); seq_printf(m, "faux/mst: %*ph\n", 2, buf); - ret = drm_dp_dpcd_read(mgr->aux, DP_MSTM_CTRL, buf, 1); + drm_dp_dpcd_read(mgr->aux, DP_MSTM_CTRL, buf, 1); seq_printf(m, "mst ctrl: %*ph\n", 1, buf); /* dump the standard OUI branch header */ - ret = drm_dp_dpcd_read(mgr->aux, DP_BRANCH_OUI, buf, DP_BRANCH_OUI_HEADER_SIZE); + drm_dp_dpcd_read(mgr->aux, DP_BRANCH_OUI, buf, DP_BRANCH_OUI_HEADER_SIZE); seq_printf(m, "branch oui: %*phN devid: ", 3, buf); for (i = 0x3; i < 0x8 && buf[i]; i++) seq_printf(m, "%c", buf[i]); -- 2.15.0