Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2501046imb; Mon, 4 Mar 2019 06:48:31 -0800 (PST) X-Google-Smtp-Source: APXvYqy3orRHu1lfdZCnuMbBqQc5W/gQ7l/7x0TMtg1tNzFS8gmvTdRBK+sbKjtJ1Brh1a7xpDvh X-Received: by 2002:a17:902:e60e:: with SMTP id cm14mr20700414plb.192.1551710911018; Mon, 04 Mar 2019 06:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551710911; cv=none; d=google.com; s=arc-20160816; b=q1tuxsXofeEs9V9b6H9gHMlEsM9hW2zpb2T8oIO4biZDh8SWkxhvYrFqjU95dZiG4x DVy8M3DlZiw4xZ2vGf88HXjK8RgQIk70SMcFmpsZLdVSXqbiXuhGer9FUlxMon0FXSeq RUKbUF6EiTywS2lwRSPTz3m0UPd1Wd7BvsWKJpPmA+PHSqcZkkAT9sekGW6/DNs/VrNj 3Md6S2yXPyw7IUJSylrlSON4AyGn7WJTCLpqpt8nJaZgZLCcWm1mpWbIeAsZ0WAQMhIn OAZXv1e4fTrs8f522DGWI/7GjWMfRZLU2xpjM1jc+IuqA8/xo5iyuP2rinf9ETu5+DIV wNew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=38HjFUpy4MlogcIi9m9SMhfuS6rSgMelTpStm3tQ3Mo=; b=b3KVoxuD2MbM9sXXV2/Jw1Ci6XnlJJO43l7OmOKGHoDxbPvOKyUnUQZe8gAC0UfM1h +IMg7mTfGcmGUjiKOjAiZcuI7KQPL5Bv8hZmbfrDE1zBLCBUhPMDO3+niG7iPgUYZWlx xsFUJcOncoMty3RyenOpNCVNF0+YD7+XZlp4lSgVpc+T6TaNcUmSxMMd2iHCfLYagSC3 +oV99FK+8JmGMaPVtS028LEuo+6ptLMS62mGX4Kb0kgBbQtPyx7uT0hjw4BR45GG+kAJ B/0yYBncZBvoxxUb0bRqpf1+qafS3pJN724wkZOA8B5uifJwTBpQiKGTiRDV832pYU3t Fqgg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si5929732plb.140.2019.03.04.06.48.15; Mon, 04 Mar 2019 06:48:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfCDOQd (ORCPT + 99 others); Mon, 4 Mar 2019 09:16:33 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:54886 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726063AbfCDOQd (ORCPT ); Mon, 4 Mar 2019 09:16:33 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 23F4B18B1E2CD08BB121; Mon, 4 Mar 2019 22:16:10 +0800 (CST) Received: from [127.0.0.1] (10.74.221.148) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.408.0; Mon, 4 Mar 2019 22:16:09 +0800 Subject: Re: [PATCH -next] net: dsa: mv88e6xxx: Fix build warning when CONFIG_NET_DSA_LEGACY is n To: Andrew Lunn References: <1551703381-52115-1-git-send-email-zhangshaokun@hisilicon.com> <20190304132617.GB26378@lunn.ch> CC: , , Heiner Kallweit , Vivien Didelot , "Florian Fainelli" , "David S. Miller" From: Zhangshaokun Message-ID: Date: Mon, 4 Mar 2019 22:16:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20190304132617.GB26378@lunn.ch> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.221.148] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On 2019/3/4 21:26, Andrew Lunn wrote: > On Mon, Mar 04, 2019 at 08:43:01PM +0800, Shaokun Zhang wrote: >> When CONFIG_NET_DSA_LEGACY is n, there is a GCC bulid warning: >> drivers/net/dsa/mv88e6xxx/chip.c:4623:13: warning: ‘mv88e6xxx_ports_cmode_init’ defined but not used [-Wunused-function] >> static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip) >> Let's fix it. > > Hi Shaokun, Heiner > > Although this fixes the warning, i suspect there i something wrong > with the original patch adding mv88e6390x_port_set_cmode(). It should > also be used without CONFIG_NET_DSA_LEGACY. I checked the commit-id 2a93c1a3651f ("net: dsa: Allow compiling out legacy support") by Florian. Do you mean that CONFIG_NET_DSA_LEGACY shall be removed completely? :-) Thanks, Shaokun > > Andrew > > >> >> Fixes: ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode") >> Cc: Heiner Kallweit >> Cc: Andrew Lunn >> Cc: Vivien Didelot >> Cc: Florian Fainelli >> Cc: "David S. Miller" >> Signed-off-by: Shaokun Zhang >> --- >> drivers/net/dsa/mv88e6xxx/chip.c | 16 ++++++++-------- >> 1 file changed, 8 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c >> index e4ad16b2dc38..168d4898c36f 100644 >> --- a/drivers/net/dsa/mv88e6xxx/chip.c >> +++ b/drivers/net/dsa/mv88e6xxx/chip.c >> @@ -4620,14 +4620,6 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip, >> return 0; >> } >> >> -static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip) >> -{ >> - int i; >> - >> - for (i = 0; i < mv88e6xxx_num_ports(chip); i++) >> - chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID; >> -} >> - >> static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, >> int port) >> { >> @@ -4637,6 +4629,14 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, >> } >> >> #if IS_ENABLED(CONFIG_NET_DSA_LEGACY) >> +static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip) >> +{ >> + int i; >> + >> + for (i = 0; i < mv88e6xxx_num_ports(chip); i++) >> + chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID; >> +} >> + >> static const char *mv88e6xxx_drv_probe(struct device *dsa_dev, >> struct device *host_dev, int sw_addr, >> void **priv) >> -- >> 2.7.4 >> > > . >