Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1653515
| Path | csiph.com!news.freedyn.net!open-news-network.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Florian Fainelli <f.fainelli@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support |
| Date | Tue, 30 May 2017 21:30:02 +0200 |
| Message-ID | <tMV06-2Xx-13@gated-at.bofh.it> (permalink) |
| References | <tMRpw-GU-29@gated-at.bofh.it> <tMUdI-2qm-11@gated-at.bofh.it> <tMUQq-2TU-19@gated-at.bofh.it> |
| X-Original-To | John Crispin <john@phrozen.org>, kbuild test robot <lkp@intel.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kkpj+nCUQSBT2ZZUU51M8mBFTVWpc4DmUuvrho2AZVo=; b=Zbq9yg/50lFIjAQSwiB/2BGIa6w1Xv/5s7bFnfyKxJYLV8iuqmzu65v/fZoAMvh7+G xysIJvPsgjSNp993Z1ACNfLfAh7WfQonH4L8jDcLN2f+QMv1B/TUvTiUh9PGIbWwuBIZ m/FcLHnxVID3p0C71XMkKUWqYS+KLyFALW4rNCMCHKvuwV4eQO7BD3bO355xoecOlpV3 UIObDfFsapx8nFsqqKpm8lW4ESwuOFk1+GcxH53lsfwe87CFhKkltSrYk++snpEQ2RXd 9QeEJf1Em8a2Y5pR5ktlytURog8CUcTtn+SczTEe3LdTb4BVUttvX0NiuTGb4qekFp71 S3gg== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kkpj+nCUQSBT2ZZUU51M8mBFTVWpc4DmUuvrho2AZVo=; b=jJM4LS7VCPTxWyCDusbEzbXrihSt/wl4zIoGYePPdikGkcBh6Q9Jki3E03gzr9TZYy V3MiM3WPpFnfxPk+7ku4ehQeBpN55rLor3tH1N9ohqYEyOMoqcwS13C8+handZkJavsx U/V88hDSgqhj0SOnWiDe5YkoLjPMuCbmbHu3UCpW+WgBc1lS/QpeAzg1wBYP6fCGFXkW WcafI6dBf++vw0qLfkuBhL52JmpOWiNAZcarGWu39rmrWQWX2/uu4jv8XxWGlSz+jVm7 GwNZ0hZm68w/ZtQpnEpKCI9kCH/jeFMiYm+J4p1Nxn5y2dDtS6XUubh13h7ftbCviFii 4lpQ== |
| X-Gm-Message-State | AODbwcCu2DIrP/OaBN8dmWFTmS7cZ2a+bCLHCs7Tkyt7iOuX9VQMGX+l 3MAPfVKpYNEdipgOxRs= |
| X-Received | by 10.233.237.79 with SMTP id c76mr25393899qkg.76.1496172196717; Tue, 30 May 2017 12:23:16 -0700 (PDT) |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Language | en-US |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 121 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | kbuild-all@01.org, Andrew Lunn <andrew@lunn.ch>, Vivien Didelot <vivien.didelot@savoirfairelinux.com>, "David S . Miller" <davem@davemloft.net>, Sean Wang <sean.wang@mediatek.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Tue, 30 May 2017 12:23:14 -0700 |
| X-Original-Message-ID | <39b72ae8-eafd-a984-05d1-0327088fa1e8@gmail.com> |
| X-Original-References | <201705302336.BC8366CF%fengguang.wu@intel.com> <7d8cdddb-f107-9945-f366-12d320ecb188@phrozen.org> <979a011e-0f41-a919-9d46-1f8258b645af@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1653515 |
Show key headers only | View raw
On 05/30/2017 12:15 PM, Florian Fainelli wrote:
> Hi John,
>
> On 05/30/2017 11:37 AM, John Crispin wrote:
>> Hi,
>>
>> the patch series is based on net-next from 12 hours ago and works fine
>> on that tree. I compile and runtime tested it quite intensively on
>> various boards
>
> The warning is legit though:
>
> 572 if (dsa_port_is_cpu(port))
> 573 err = dsa_cpu_parse(port, index, dst, ds);
> > 574 else if (dsa_is_normal_port(port))
> 575 err = dsa_user_parse(port->dn, index, ds);
>
> and after applying your patches I also met it:
>
> net/dsa/dsa2.c: In function 'dsa_ds_parse':
> net/dsa/dsa2.c:574:3: warning: passing argument 1 of
> 'dsa_is_normal_port' from incompatible pointer type [enabled by default]
> else if (dsa_is_normal_port(port))
> ^
> In file included from net/dsa/dsa_priv.h:17:0,
> from net/dsa/dsa2.c:22:
> ./include/net/dsa.h:264:20: note: expected 'struct dsa_switch *' but
> argument is of type 'struct dsa_port *'
> static inline bool dsa_is_normal_port(struct dsa_switch *ds, int p)
> ^
> net/dsa/dsa2.c:574:3: error: too few arguments to function
> 'dsa_is_normal_port'
> else if (dsa_is_normal_port(port))
> ^
> In file included from net/dsa/dsa_priv.h:17:0,
> from net/dsa/dsa2.c:22:
> ./include/net/dsa.h:264:20: note: declared here
> static inline bool dsa_is_normal_port(struct dsa_switch *ds, int p)
> ^
> CC net/bridge/br_stp.o
> scripts/Makefile.build:302: recipe for target 'net/dsa/dsa2.o' failed
> make[4]: *** [net/dsa/dsa2.o] Error 1
> scripts/Makefile.build:561: recipe for target 'net/dsa' failed
> make[3]: *** [net/dsa] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> We need something like this, I have some comments on your patches that I
> will send shortly. Thanks!
>
> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
> index 8b13aa735c40..124c5acfa123 100644
> --- a/net/dsa/dsa2.c
> +++ b/net/dsa/dsa2.c
> @@ -539,14 +539,14 @@ static int dsa_cpu_parse(struct dsa_port *port,
> u32 index,
> return 0;
> }
>
> -static int dsa_user_parse(struct device_node *port, u32 index,
> +static int dsa_user_parse(struct dsa_port *port, u32 index,
> struct dsa_switch *ds)
> {
> struct device_node *cpu_port;
> const unsigned int *cpu_port_reg;
> int cpu_port_index;
>
> - cpu_port = of_parse_phandle(port, "cpu", 0);
> + cpu_port = of_parse_phandle(port->dn, "cpu", 0);
> if (cpu_port) {
> cpu_port_reg = of_get_property(cpu_port, "reg", NULL);
> if (!cpu_port_reg)
> @@ -572,7 +572,7 @@ static int dsa_ds_parse(struct dsa_switch_tree *dst,
> struct dsa_switch *ds)
> if (dsa_port_is_cpu(port))
> err = dsa_cpu_parse(port, index, dst, ds);
> else if (dsa_is_normal_port(port))
> - err = dsa_user_parse(port->dn, index, ds);
> + err = dsa_user_parse(port, index, ds);
>
> if (err)
> return err;
here is a version that builds, I missed one hunk:
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 8b13aa735c40..d71a2a610340 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -539,14 +539,14 @@ static int dsa_cpu_parse(struct dsa_port *port,
u32 index,
return 0;
}
-static int dsa_user_parse(struct device_node *port, u32 index,
+static int dsa_user_parse(struct dsa_port *port, u32 index,
struct dsa_switch *ds)
{
struct device_node *cpu_port;
const unsigned int *cpu_port_reg;
int cpu_port_index;
- cpu_port = of_parse_phandle(port, "cpu", 0);
+ cpu_port = of_parse_phandle(port->dn, "cpu", 0);
if (cpu_port) {
cpu_port_reg = of_get_property(cpu_port, "reg", NULL);
if (!cpu_port_reg)
@@ -571,8 +571,8 @@ static int dsa_ds_parse(struct dsa_switch_tree *dst,
struct dsa_switch *ds)
if (dsa_port_is_cpu(port))
err = dsa_cpu_parse(port, index, dst, ds);
- else if (dsa_is_normal_port(port))
- err = dsa_user_parse(port->dn, index, ds);
+ else if (dsa_is_normal_port(ds, index))
+ err = dsa_user_parse(port, index, ds);
if (err)
return err;
--
Florian
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support John Crispin <john@phrozen.org> - 2017-05-30 20:40 +0200
Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support Florian Fainelli <f.fainelli@gmail.com> - 2017-05-30 21:20 +0200
Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support Florian Fainelli <f.fainelli@gmail.com> - 2017-05-30 21:30 +0200
csiph-web