[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230315000657.1ab9d9f4@kernel.org>
Date: Wed, 15 Mar 2023 00:06:57 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Álvaro Fernández Rojas <noltari@...il.com>
Cc: f.fainelli@...il.com, jonas.gorski@...il.com, andrew@...n.ch,
olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: dsa: b53: mmap: fix device tree support
On Fri, 10 Mar 2023 13:10:59 +0100 Álvaro Fernández Rojas wrote:
> diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
> index e968322dfbf0..24ea2e19dfa6 100644
> --- a/drivers/net/dsa/b53/b53_mmap.c
> +++ b/drivers/net/dsa/b53/b53_mmap.c
> @@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,
> if (of_property_read_u32(of_port, "reg", ®))
> continue;
>
> - if (reg < B53_CPU_PORT)
> + if (reg <= B53_CPU_PORT)
> pdata->enabled_ports |= BIT(reg);
Should we switch to B53_N_PORTS instead?
That's the bound used by the local "for each port" macro:
#define b53_for_each_port(dev, i) \
for (i = 0; i < B53_N_PORTS; i++) \
if (dev->enabled_ports & BIT(i))
Powered by blists - more mailing lists