]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commiteea418cedcf3555c7713ef34ab3ba69d8652aa50
tree6e44053d4ef11dc8bdb92c3ecb1b8e9111fd528f
parent51eadb99504a5c527c20617507f45c8414b6c8b3
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