Commit 0c1d6b26 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

mlxsw: spectrum_router: Pass destination IP as a pointer to mlxsw_reg_ralue_pack4()

Instead of passing destination IP as a u32 value, pass it as pointer to
u32. Avoid using local variable for the pointer store.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d271cf9f
...@@ -7279,10 +7279,10 @@ static inline void mlxsw_reg_ralue_pack4(char *payload, ...@@ -7279,10 +7279,10 @@ static inline void mlxsw_reg_ralue_pack4(char *payload,
enum mlxsw_reg_ralxx_protocol protocol, enum mlxsw_reg_ralxx_protocol protocol,
enum mlxsw_reg_ralue_op op, enum mlxsw_reg_ralue_op op,
u16 virtual_router, u8 prefix_len, u16 virtual_router, u8 prefix_len,
u32 dip) u32 *dip)
{ {
mlxsw_reg_ralue_pack(payload, protocol, op, virtual_router, prefix_len); mlxsw_reg_ralue_pack(payload, protocol, op, virtual_router, prefix_len);
mlxsw_reg_ralue_dip4_set(payload, dip); mlxsw_reg_ralue_dip4_set(payload, *dip);
} }
static inline void mlxsw_reg_ralue_pack6(char *payload, static inline void mlxsw_reg_ralue_pack6(char *payload,
......
...@@ -4314,7 +4314,6 @@ mlxsw_sp_fib_entry_ralue_pack(char *ralue_pl, enum mlxsw_sp_l3proto proto, ...@@ -4314,7 +4314,6 @@ mlxsw_sp_fib_entry_ralue_pack(char *ralue_pl, enum mlxsw_sp_l3proto proto,
{ {
enum mlxsw_reg_ralxx_protocol ralxx_proto; enum mlxsw_reg_ralxx_protocol ralxx_proto;
enum mlxsw_reg_ralue_op ralue_op; enum mlxsw_reg_ralue_op ralue_op;
u32 *p_dip;
ralxx_proto = (enum mlxsw_reg_ralxx_protocol) proto; ralxx_proto = (enum mlxsw_reg_ralxx_protocol) proto;
...@@ -4332,9 +4331,8 @@ mlxsw_sp_fib_entry_ralue_pack(char *ralue_pl, enum mlxsw_sp_l3proto proto, ...@@ -4332,9 +4331,8 @@ mlxsw_sp_fib_entry_ralue_pack(char *ralue_pl, enum mlxsw_sp_l3proto proto,
switch (proto) { switch (proto) {
case MLXSW_SP_L3_PROTO_IPV4: case MLXSW_SP_L3_PROTO_IPV4:
p_dip = (u32 *) addr;
mlxsw_reg_ralue_pack4(ralue_pl, ralxx_proto, ralue_op, mlxsw_reg_ralue_pack4(ralue_pl, ralxx_proto, ralue_op,
virtual_router, prefix_len, *p_dip); virtual_router, prefix_len, (u32 *) addr);
break; break;
case MLXSW_SP_L3_PROTO_IPV6: case MLXSW_SP_L3_PROTO_IPV6:
mlxsw_reg_ralue_pack6(ralue_pl, ralxx_proto, ralue_op, mlxsw_reg_ralue_pack6(ralue_pl, ralxx_proto, ralue_op,
......
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