diff options
author | Arkadi Sharshevsky <arkadis@mellanox.com> | 2017-03-25 08:28:22 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-25 19:56:15 -0700 |
commit | 1312444374241f0e4dd0406ad8967a8b13bb6d69 (patch) | |
tree | 2d22aabd7b24372ecd830ff251ce5227a1133d45 /drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c | |
parent | 2239cc634395ecce69dd047be9104f71edc417b4 (diff) | |
download | linux-stable-1312444374241f0e4dd0406ad8967a8b13bb6d69.tar.gz linux-stable-1312444374241f0e4dd0406ad8967a8b13bb6d69.tar.bz2 linux-stable-1312444374241f0e4dd0406ad8967a8b13bb6d69.zip |
mlxsw: spectrum_kvdl: Cosmetic kvdl allocator API change
Currently the return allocated index and err value are multiplexed.
This patch changes the API to decouple the ret value from the allocated
index.
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c index ac321e8e5c1a..26c26cd30c3d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c @@ -45,7 +45,8 @@ (MLXSW_SP_KVD_LINEAR_SIZE - MLXSW_SP_KVDL_CHUNKS_BASE) #define MLXSW_SP_CHUNK_MAX 32 -int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count) +int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count, + u32 *p_entry_index) { int entry_index; int size; @@ -72,7 +73,8 @@ int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count) for (i = 0; i < type_entries; i++) set_bit(entry_index + i, mlxsw_sp->kvdl.usage); - return entry_index; + *p_entry_index = entry_index; + return 0; } return -ENOBUFS; } |