netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches
@ 2016-04-15 13:09 Jiri Pirko
  2016-04-15 13:09 ` [patch net-next 1/2] mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-04-15 13:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz, David.Laight

From: Jiri Pirko <jiri@mellanox.com>

As suggested by David Laight

Jiri Pirko (2):
  mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs
  mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb

 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch net-next 1/2] mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs
  2016-04-15 13:09 [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches Jiri Pirko
@ 2016-04-15 13:09 ` Jiri Pirko
  2016-04-15 13:09 ` [patch net-next 2/2] mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb Jiri Pirko
  2016-04-15 17:03 ` [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-04-15 13:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz, David.Laight

From: Jiri Pirko <jiri@mellanox.com>

Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
index f2e073a..64166dd 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
@@ -162,16 +162,8 @@ 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)
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch net-next 2/2] mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb
  2016-04-15 13:09 [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches Jiri Pirko
  2016-04-15 13:09 ` [patch net-next 1/2] mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs Jiri Pirko
@ 2016-04-15 13:09 ` Jiri Pirko
  2016-04-15 17:03 ` [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-04-15 13:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz, David.Laight

From: Jiri Pirko <jiri@mellanox.com>

Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
index 64166dd..a3720a0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
@@ -167,6 +167,7 @@ static const u16 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)
 {
@@ -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,
 			    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]);
 	}
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches
  2016-04-15 13:09 [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches Jiri Pirko
  2016-04-15 13:09 ` [patch net-next 1/2] mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs Jiri Pirko
  2016-04-15 13:09 ` [patch net-next 2/2] mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb Jiri Pirko
@ 2016-04-15 17:03 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-04-15 17:03 UTC (permalink / raw)
  To: jiri; +Cc: netdev, idosch, eladr, yotamg, ogerlitz, David.Laight

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 15 Apr 2016 15:09:36 +0200

> As suggested by David Laight

Series applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-15 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15 13:09 [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches Jiri Pirko
2016-04-15 13:09 ` [patch net-next 1/2] mlxsw: spectrum_buffers: Use designated initializers for mlxsw_sp_pbs Jiri Pirko
2016-04-15 13:09 ` [patch net-next 2/2] mlxsw: spectrum_buffers: Use MLXSW_SP_PB_UNUSED define for unused pb Jiri Pirko
2016-04-15 17:03 ` [patch net-next 0/2] mlxsw: spectrum_buffers: couple of cosmetic patches David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).