mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: "Jakub Kicinski" <kuba@kernel.org>,
	"Álvaro Fernández Rojas" <noltari@gmail.com>
Cc: jonas.gorski@gmail.com, andrew@lunn.ch, olteanv@gmail.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dsa: b53: mmap: fix device tree support
Date: Wed, 15 Mar 2023 11:29:02 -0700	[thread overview]
Message-ID: <df32b84d-a39d-7dfe-c172-040ecf16f9c5@gmail.com> (raw)
In-Reply-To: <20230315000657.1ab9d9f4@kernel.org>

On 3/15/23 00:06, Jakub Kicinski wrote:
> 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", &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))

Yes, checking against B53_N_PORTS would be a better check.
-- 
Florian


  reply	other threads:[~2023-03-15 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 12:10 Álvaro Fernández Rojas
2023-03-15  7:06 ` Jakub Kicinski
2023-03-15 18:29   ` Florian Fainelli [this message]
2023-03-16 17:28 ` [PATCH v2] " Álvaro Fernández Rojas
2023-03-16 17:30   ` Florian Fainelli
2023-03-18  5:00   ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df32b84d-a39d-7dfe-c172-040ecf16f9c5@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=noltari@gmail.com \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®