[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <369a47f7-8194-73bc-34a4-687f2e554438@intel.com>
Date: Wed, 12 Apr 2023 14:11:26 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Vladimir Oltean <vladimir.oltean@....com>, <netdev@...r.kernel.org>
CC: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
"Claudiu Manoil" <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
<UNGLinuxDriver@...rochip.com>,
Colin Foster <colin.foster@...advantage.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 1/8] net: mscc: ocelot: strengthen type of "u32
reg" in I/O accessors
On 4/12/2023 5:47 AM, Vladimir Oltean wrote:
> The "u32 reg" argument that is passed to these functions is not a plain
> address, but rather a driver-specific encoding of another enum
> ocelot_target target in the upper bits, and an index into the
> u32 ocelot->map[target][] array in the lower bits. That encoded value
> takes the type "enum ocelot_reg" and is what is passed to these I/O
> functions, so let's actually use that to prevent type confusion.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
It does make the prototypes a bit longer, but clarity of the type of
value you need to pass is good.
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists