mlxsw: core_hwmon: Calculate MLXSW_HWMON_ATTR_COUNT more accurately
authorAmit Cohen <amitc@mellanox.com>
Thu, 3 Sep 2020 13:41:45 +0000 (16:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Sep 2020 19:12:05 +0000 (12:12 -0700)
commit02bed4e8b705284b593948676ebe1c6629dc5895
tree6e44053d4ef11dc8bdb92c3ecb1b8e9111fd528f
parentad38d47b2f9b7f8247ae1527a66a5924a585ab5a
mlxsw: core_hwmon: Calculate MLXSW_HWMON_ATTR_COUNT more accurately

Currently the value of MLXSW_HWMON_ATTR_COUNT is calculated not really
accurate.

Add several defines to make the calculation clearer and easier to
change.

Calculate the precise high bound of number of attributes that may be
needed.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c