From patchwork Wed Apr 7 09:15:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 416673 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp290635jai; Wed, 7 Apr 2021 02:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZZ/bgjo2KIVir0d/1AS5ZsU7hpJH+5vazpZE2q41rw0D56Eld82bJMN1wOm72wsCaGR1i X-Received: by 2002:a17:906:3649:: with SMTP id r9mr2598708ejb.342.1617786997614; Wed, 07 Apr 2021 02:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617786997; cv=none; d=google.com; s=arc-20160816; b=EmmrO7juBPfNwiP589OzDquHDPsuyiCjnAJohjL7BXLLNtNsQtFhAZXNqrOl16otLu HLkxyqodUzlAuGo2aoQ/tkWgWjbNewtVqIHq5fluVEy1ejgppf3SGR27Is6rGUWgvPmn dUtpgV5psRp6yKdLG5ysIVbqCoqsBbZLj2wsWrisxANp0BOGYihnwCdG7UB5a6gTv8jC tGusl77bobuWmT6551fqox7KIUHbqS8LVbB1Oyq7IerSZ58ZCuePNv3+IfF8UGeaaSPA /aGDnQ7UJFWm0wCcAD9fcHW4IqouKVrka/wFsxw/6nOzqmzmwXKpM1DUD3wgz9Ic2G0l DnOA== 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; bh=m1anZTjT6GBR+E46WQxN80M8xhQO3S0ndAn5VIiTNKk=; b=TS0XG/nwg6s/TlEamcX+DkFE5SrQpL/g8CEaHv2CfuPffhL+PyL9KZUBJMOqEJ/jUQ 6vqhuP5CqwJo1Gqr4SFrcbCtq+EWOssDjc9g/cTW1legzxeSxhq/Za/HuWMXmmPSeUQL boT838mCRt+mediW61vKFUD3yuBb6XHX4eREwlGNndMaDgWkaGLqn8bM9vme5XP821L+ 2rYG7eMEyea2CfLfk+58smBARk7dqDqA3zXqaaGqKl2sNmR8LE+kiIn3bLYNLXSKlupR UWAeGWOV4vsxA14rKF1jCZBrWEa+BXkH51IjC0Uud0v/o54GPBq3HPgqmW7OGnTVBxwG t1uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si19530515edq.562.2021.04.07.02.16.37; Wed, 07 Apr 2021 02:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345811AbhDGJQk (ORCPT + 3 others); Wed, 7 Apr 2021 05:16:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:16008 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231878AbhDGJQk (ORCPT ); Wed, 7 Apr 2021 05:16:40 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FFdx310tBzPnwC; Wed, 7 Apr 2021 17:13:43 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.179.202) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Wed, 7 Apr 2021 17:16:18 +0800 From: Zhen Lei To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , linux-usb , linux-kernel CC: Zhen Lei , Hans de Goede Subject: [PATCH 1/1] usb: typec: tcpm: remove unused static variable 'tcpm_altmode_ops' Date: Wed, 7 Apr 2021 17:15:40 +0800 Message-ID: <20210407091540.2815-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.202] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Fixes the following W=1 kernel build warning: drivers/usb/typec/tcpm/tcpm.c:2107:39: warning: ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=] The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism"). By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly. Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/usb/typec/tcpm/tcpm.c | 60 ------------------------------------------- 1 file changed, 60 deletions(-) -- 1.8.3 Acked-by: Heikki Krogerus Reviewed-by: Guenter Roeck diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index ce7af398c7c1c1f..2f89bae29c0c297 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header, mod_vdm_delayed_work(port, 0); } -static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header, - const u32 *data, int cnt) -{ - mutex_lock(&port->lock); - tcpm_queue_vdm(port, header, data, cnt); - mutex_unlock(&port->lock); -} - static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt) { u32 vdo = p[VDO_INDEX_IDH]; @@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port, * * And we also have this ordering: * 1. alt-mode driver takes the alt-mode's lock - * 2. alt-mode driver calls tcpm_altmode_enter which takes the - * tcpm port lock * * Dropping our lock here avoids this. */ @@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo, return 0; } -static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - int svdm_version; - u32 header; - - svdm_version = typec_get_negotiated_svdm_version(port->typec_port); - if (svdm_version < 0) - return svdm_version; - - header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE); - header |= VDO_OPOS(altmode->mode); - - tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0); - return 0; -} - -static int tcpm_altmode_exit(struct typec_altmode *altmode) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - int svdm_version; - u32 header; - - svdm_version = typec_get_negotiated_svdm_version(port->typec_port); - if (svdm_version < 0) - return svdm_version; - - header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE); - header |= VDO_OPOS(altmode->mode); - - tcpm_queue_vdm_unlocked(port, header, NULL, 0); - return 0; -} - -static int tcpm_altmode_vdm(struct typec_altmode *altmode, - u32 header, const u32 *data, int count) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - - tcpm_queue_vdm_unlocked(port, header, data, count - 1); - - return 0; -} - -static const struct typec_altmode_ops tcpm_altmode_ops = { - .enter = tcpm_altmode_enter, - .exit = tcpm_altmode_exit, - .vdm = tcpm_altmode_vdm, -}; - /* * PD (data, control) command handling functions */