aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-04-15 13:02:43 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-15 13:02:43 -0400
commit25fb0b6c73122a4718cf218a164e468b11449a2d (patch)
tree1d9c535c55479deb621522e4b7046a638b94701f
parentdevlink: fix sb register stub in case devlink is disabled (diff)
parentmlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb (diff)
downloadlinux-dev-25fb0b6c73122a4718cf218a164e468b11449a2d.tar.xz
linux-dev-25fb0b6c73122a4718cf218a164e468b11449a2d.zip
Merge branch 'mlxsw-next'
Jiri Pirko says: ==================== mlxsw: spectrum_buffers: couple of cosmetic patches As suggested by David Laight ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
index f2e073af5dd2..a3720a0fad7d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
@@ -162,19 +162,12 @@ static int mlxsw_sp_sb_pm_occ_query(struct mlxsw_sp *mlxsw_sp, u8 local_port,
}
static const u16 mlxsw_sp_pbs[] = {
- 2 * MLXSW_SP_BYTES_TO_CELLS(ETH_FRAME_LEN),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0, /* Unused */
- 2 * MLXSW_SP_BYTES_TO_CELLS(MLXSW_PORT_MAX_MTU),
+ [0] = 2 * MLXSW_SP_BYTES_TO_CELLS(ETH_FRAME_LEN),
+ [9] = 2 * MLXSW_SP_BYTES_TO_CELLS(MLXSW_PORT_MAX_MTU),
};
#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)
{
@@ -184,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,
0xffff, 0xffff / 2);
for (i = 0; i < MLXSW_SP_PBS_LEN; i++) {
- if (i == 8)
+ if (i == MLXSW_SP_PB_UNUSED)
continue;
mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl, i, mlxsw_sp_pbs[i]);
}