Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2507164imb; Mon, 4 Mar 2019 06:57:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzdE4ZMH01ANy8+s6ocWHLjq9EJQ26avrTxjJyaYdERF2IubQoLZFJ/nHICA6NYvrKo6yO6 X-Received: by 2002:a63:702:: with SMTP id 2mr18890211pgh.14.1551711473959; Mon, 04 Mar 2019 06:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551711473; cv=none; d=google.com; s=arc-20160816; b=QkDp3/PQAPEwjZ3/BR6eylinT+uJxu4MjhDgxHLsYW7+8PHS/gmJk9CeTYddXmPfHV s5PBkuqZ3YrauxEeucMpRSA9t3no6sVpIelI3eeNEcfshLRPspoepSU0h3ae8vVgc324 bg21i08DWx2Au8H9OQuUPC2mf6Bb/ooFhHzY7pZeQDuIj6YkSkJhAvLFjvLIc3CzNJln qBRqx6n8R3oF80dprjimmvFappVU+BsxL4BD0TjSOemEq/LIJ+eGSp+nhTzbVZIDa6HV nINk1nm+ohrlz6bxqOeCQyXV7nmD03GHucOjY156o5DlWgbxl+HR+eWqvZ4NqqOmHT4T IbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n4linaU+uDO7QNRj5tUU6AY16NLLKMqeRHdXePGlAp8=; b=HiMDbQgLjtHtXJib2bhdAH39ykDiHbRKEF+Xtq5k4hJixbwoRuD2tLOb+mOrPl4L8u fidapIeQIXX3gEZSSoRanreKST66godmqHUAO/cE/Q57/W5C5lHZuJ4fbAGk7KgYfok6 AxOxIk3ghqVXmE7OVicMYr3TLJNJwR9FduRyCKOB+IIY49R0YFOw8zr/RSHDm2APkqCx Dq4QWh/FiK/uhAIvkn97N0c3hKiKi9/FM9UhWLFDXhJyni0CsScrPuMnl4Qu6uyt04sW dcI1/Rr8eN5BAwqYcNiJLQpHd4FSsj+DW6+JIjaX2KL55mg29AcQ8cPw1GLpWPcpE0+p jmpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=sZK88eKF; 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 y192si5795536pfb.127.2019.03.04.06.57.38; Mon, 04 Mar 2019 06:57:53 -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=fail header.i=@lunn.ch header.s=20171124 header.b=sZK88eKF; 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 S1726746AbfCDO5Q (ORCPT + 99 others); Mon, 4 Mar 2019 09:57:16 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45844 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfCDO5P (ORCPT ); Mon, 4 Mar 2019 09:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=n4linaU+uDO7QNRj5tUU6AY16NLLKMqeRHdXePGlAp8=; b=sZK88eKFrVgcXFF9q7ytCJwywR G10FTLf5D5Y1ckCnvAslQeam5DFLoE0wk4q9vjIDHGfyA1JU6YAHux9/l+fXwgP7YyoOkjtH1VuaV Y3gaE3thHFl+M8oRkHBx4SMfb2/ogz5WT7SkNm0MwZHV1cdtHxNJdT0G6MLmhx5AOxz0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1h0p1i-0004ll-K4; Mon, 04 Mar 2019 15:57:10 +0100 Date: Mon, 4 Mar 2019 15:57:10 +0100 From: Andrew Lunn To: Zhangshaokun Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heiner Kallweit , Vivien Didelot , Florian Fainelli , "David S. Miller" Subject: Re: [PATCH -next] net: dsa: mv88e6xxx: Fix build warning when CONFIG_NET_DSA_LEGACY is n Message-ID: <20190304145710.GA17097@lunn.ch> References: <1551703381-52115-1-git-send-email-zhangshaokun@hisilicon.com> <20190304132617.GB26378@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. [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 :-( Andrew