Messages in this thread | | | Date | Wed, 12 Apr 2023 14:11:26 -0700 | Subject | Re: [PATCH net-next 1/8] net: mscc: ocelot: strengthen type of "u32 reg" in I/O accessors | From | Jacob Keller <> |
| |
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@nxp.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@intel.com>
| |