Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp867381pxf; Wed, 7 Apr 2021 13:41:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhyDU96hyI68ORAWNgBxKuQ3O79yaLraEQkONduevahFwbPsd9P+K+wxTdDzNP4o1zgGAU X-Received: by 2002:a17:907:9858:: with SMTP id jj24mr5938524ejc.212.1617828104119; Wed, 07 Apr 2021 13:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617828104; cv=none; d=google.com; s=arc-20160816; b=C6c93VP6n2wqE955zx14Tdv9JKB/xgFXNhAbfhTOzuQeP3xyYlbFXDze/5+PkSX5px uErHlmtNhmKuHoZwP3ELi5YBXC5Ui21ctf4zZiE4fY3hdpWwJPjUY96mvVFXG3Z2MoxB 51aRlIcNXXWy7HAydmW17F5j+MXN7FTjY3VcqAKb6qs6Yll4u6eaEPnmxJpnVnrjO7r6 BkH76P25JUmYquFAy6n0yI7ujItwgJPQHVCDiouItIL+LyNzvzstzbyxpX2WH+uKGkf/ Q12Qkrn+tuczBCGnMndL+pgDZKMmL5yJPF1Y6tNOzohrP9SNUim5fTLxZL1iPZAbCwlo thYg== 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=zRDjBRW1seUsSdswmZi5CIas4jBHPbtY3i8G98REm2z8yxqPCzTz6BALSi0BdW8myw EEZXaWcxO33Zc7dlWX0motto/YEe23NpsQNyCRJltSrWm7tpoWyZdCiizbTQ6RuNT7SH XvtPRD8YicMOuNE5LyznmZeJQR7iKTf+9KmpQhCKxCPAx/fPdX7OgMgFLLVf6JFdWAp0 CxHOkj4i1YhU50KM6cPgM8a6al1gAd8mMhGbmvnK3aPUTKNzHuzFLxjXy6gKeR0FXob3 d+c4rjYrewse8KFhWXx+voOAHGe6+XpKN3RPYJAjhwbEj/0IUlDDFP4MW9grn99/m5NB HvbA== ARC-Authentication-Results: i=1; mx.google.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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb41si19612624ejc.90.2021.04.07.13.41.21; Wed, 07 Apr 2021 13:41:44 -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; 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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345824AbhDGJQk (ORCPT + 99 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.202] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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 */ -- 1.8.3