Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2874709imb; Mon, 4 Mar 2019 16:59:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwF/lwjkAEfLcIoHdtc/Nwkggk8D7+GPfuk8f2qagpd2xTGnObVlqwdthc+SQEuluDl1YU8 X-Received: by 2002:a63:5a42:: with SMTP id k2mr21107012pgm.333.1551747567541; Mon, 04 Mar 2019 16:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551747567; cv=none; d=google.com; s=arc-20160816; b=i+RT9qDWi+vI004dW4CaCke+T07qUqNGlGFo2OxoQnkExmKGvNypHXj6WEm/lzPqpB +NqSLOraba/HXoj6As2CC0me8dBZMT5gqZefyVnwZrUvN7+HN3O0XinHjsYfXC2Lj3y8 DYDYIchOIzTc+GoiL3xkk+PjvXBwZbBddJVt1hZeQgXIgbmzfc+pZutRJprNr+nQHpaU L1dGGlwT0b2NbglPmVGMvIDS2wNiOUHHGqWP3RuHMKiwTkE6QffhgxzgDYT3U0QuaDin pDm/KREBwbol87bnyHR9crpRKRTBrgAywG+UGy1Vc7qZH5HjzzICmFb6V7bivvOn2ttv 9H/g== 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=8TsN0AqwirHG0NlsreFMVFexoTzPOsOllS53E/qKVec=; b=C2cjOnAb67HH3qi9GnGjvsm5bZh+3Fe0eYv74fKSduPJpES6SekLYLkSf9HQG+/7y+ SvelYhpIjZo3umb6T8ka4JFEivlFquUWN8wB1inhB/6HHbxqXXEVarhc8gC/IHjTwpxO AUiQ9xevofzMQIhzKjp0woGdRDllQeZuljiwRTdX7/CuHfbfRZ6t2zfkd62MCzcJueY5 zoB2ybjxonh90PUpVE/fcnMVWSjQht6Ac0V2eGf2tOgroK6vsSUxua0cTbxTNuFoe9yb +LNdt4Be1aociHh6CNm7+7Y/siUZy5G4NGVxp/IGbTeSL4QMpDsI0aLbb5b1Mi/NJcXj q34Q== 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 s17si6774347plp.100.2019.03.04.16.59.12; Mon, 04 Mar 2019 16:59:27 -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 S1726869AbfCEA57 (ORCPT + 99 others); Mon, 4 Mar 2019 19:57:59 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:37104 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726066AbfCEA57 (ORCPT ); Mon, 4 Mar 2019 19:57:59 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4620FA4B828D87ACBE96; Tue, 5 Mar 2019 08:57:56 +0800 (CST) Received: from [127.0.0.1] (10.74.221.148) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Tue, 5 Mar 2019 08:57:53 +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> <20190304145710.GA17097@lunn.ch> CC: , , Heiner Kallweit , Vivien Didelot , "Florian Fainelli" , "David S. Miller" From: Zhangshaokun Message-ID: Date: Tue, 5 Mar 2019 08:57:53 +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: <20190304145710.GA17097@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 22:57, Andrew Lunn wrote: > On Mon, Mar 04, 2019 at 10:16:08PM +0800, Zhangshaokun wrote: >> 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? :-) > > No, i suspect mv88e6390x_ports_cmode_init() is being called from the > wrong place, or needs to be called from a second location. > Ok, I didn't check it carefully. > [Goes and looks at the code] > > Yes, it should also be called in mv88e6xxx_probe(). I would call it > just after the call to mv88e6xxx_detect(), so that it is the same as > in mv88e6xxx_drv_probe(). > > There are two ways DSA drivers can be probed. The legacy way, which is > optional, and is slowly getting removed, and the current way. Heiner > is new to DSA and probably missed that, and only handled the legacy > probe method. I also missed checking when i reviewed to patch :-( > Hmm, I am not familiar wit it, please feel free to fix it. Thanks, Shaokun > Andrew > > > > > . >