Commit 3bc6f385 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

mlxsw: core_acl: Change order of args of ops->encode_block()

Change order so it is aligned with the usual case where the "write_to"
buffer comes as the first arg.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d07cd660
...@@ -452,9 +452,9 @@ void mlxsw_afk_encode(struct mlxsw_afk *mlxsw_afk, ...@@ -452,9 +452,9 @@ void mlxsw_afk_encode(struct mlxsw_afk *mlxsw_afk,
} }
if (key) if (key)
mlxsw_afk->ops->encode_block(block_key, i, key); mlxsw_afk->ops->encode_block(key, i, block_key);
if (mask) if (mask)
mlxsw_afk->ops->encode_block(block_mask, i, mask); mlxsw_afk->ops->encode_block(mask, i, block_mask);
} }
} }
EXPORT_SYMBOL(mlxsw_afk_encode); EXPORT_SYMBOL(mlxsw_afk_encode);
...@@ -188,7 +188,7 @@ struct mlxsw_afk; ...@@ -188,7 +188,7 @@ struct mlxsw_afk;
struct mlxsw_afk_ops { struct mlxsw_afk_ops {
const struct mlxsw_afk_block *blocks; const struct mlxsw_afk_block *blocks;
unsigned int blocks_count; unsigned int blocks_count;
void (*encode_block)(char *block, int block_index, char *output); void (*encode_block)(char *output, int block_index, char *block);
}; };
struct mlxsw_afk *mlxsw_afk_create(unsigned int max_blocks, struct mlxsw_afk *mlxsw_afk_create(unsigned int max_blocks,
......
...@@ -98,8 +98,8 @@ static const struct mlxsw_afk_block mlxsw_sp1_afk_blocks[] = { ...@@ -98,8 +98,8 @@ static const struct mlxsw_afk_block mlxsw_sp1_afk_blocks[] = {
#define MLXSW_SP1_AFK_KEY_BLOCK_SIZE 16 #define MLXSW_SP1_AFK_KEY_BLOCK_SIZE 16
static void mlxsw_sp1_afk_encode_block(char *block, int block_index, static void mlxsw_sp1_afk_encode_block(char *output, int block_index,
char *output) char *block)
{ {
unsigned int offset = block_index * MLXSW_SP1_AFK_KEY_BLOCK_SIZE; unsigned int offset = block_index * MLXSW_SP1_AFK_KEY_BLOCK_SIZE;
char *output_indexed = output + offset; char *output_indexed = output + offset;
...@@ -263,8 +263,8 @@ static const struct mlxsw_sp2_afk_block_layout mlxsw_sp2_afk_blocks_layout[] = { ...@@ -263,8 +263,8 @@ static const struct mlxsw_sp2_afk_block_layout mlxsw_sp2_afk_blocks_layout[] = {
MLXSW_SP2_AFK_BLOCK_LAYOUT(block11, 0x00, 12), MLXSW_SP2_AFK_BLOCK_LAYOUT(block11, 0x00, 12),
}; };
static void mlxsw_sp2_afk_encode_block(char *block, int block_index, static void mlxsw_sp2_afk_encode_block(char *output, int block_index,
char *output) char *block)
{ {
u64 block_value = mlxsw_sp2_afk_block_value_get(block); u64 block_value = mlxsw_sp2_afk_block_value_get(block);
const struct mlxsw_sp2_afk_block_layout *block_layout; const struct mlxsw_sp2_afk_block_layout *block_layout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment