mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 15:45:45 +00:00
mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb
Suggested-by: David Laight <David.Laight@ACULAB.COM> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ce78f02042
commit
b94cdabbf1
1 changed files with 2 additions and 1 deletions
|
@ -167,6 +167,7 @@ static const u16 mlxsw_sp_pbs[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MLXSW_SP_PBS_LEN ARRAY_SIZE(mlxsw_sp_pbs)
|
#define MLXSW_SP_PBS_LEN ARRAY_SIZE(mlxsw_sp_pbs)
|
||||||
|
#define MLXSW_SP_PB_UNUSED 8
|
||||||
|
|
||||||
static int mlxsw_sp_port_pb_init(struct mlxsw_sp_port *mlxsw_sp_port)
|
static int mlxsw_sp_port_pb_init(struct mlxsw_sp_port *mlxsw_sp_port)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +177,7 @@ static int mlxsw_sp_port_pb_init(struct mlxsw_sp_port *mlxsw_sp_port)
|
||||||
mlxsw_reg_pbmc_pack(pbmc_pl, mlxsw_sp_port->local_port,
|
mlxsw_reg_pbmc_pack(pbmc_pl, mlxsw_sp_port->local_port,
|
||||||
0xffff, 0xffff / 2);
|
0xffff, 0xffff / 2);
|
||||||
for (i = 0; i < MLXSW_SP_PBS_LEN; i++) {
|
for (i = 0; i < MLXSW_SP_PBS_LEN; i++) {
|
||||||
if (i == 8)
|
if (i == MLXSW_SP_PB_UNUSED)
|
||||||
continue;
|
continue;
|
||||||
mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl, i, mlxsw_sp_pbs[i]);
|
mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl, i, mlxsw_sp_pbs[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue