@@ -3338,7 +3338,7 @@ static int cmd_dev_param_show(struct dl *dl)
struct nlmsghdr *nlh;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_PARAM_GET, flags);
@@ -3494,7 +3494,7 @@ static int cmd_dev_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_GET, flags);
@@ -3714,7 +3714,7 @@ static int cmd_dev_info(struct dl *dl)
return 0;
}
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_INFO_GET, flags);
@@ -4517,7 +4517,7 @@ static int cmd_port_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_PORT_GET, flags);
@@ -4585,7 +4585,7 @@ static int cmd_port_param_show(struct dl *dl)
struct nlmsghdr *nlh;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_PORT_PARAM_GET,
@@ -4939,7 +4939,7 @@ static int cmd_port_fn_rate_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_RATE_GET, flags);
@@ -5303,7 +5303,7 @@ static int cmd_linecard_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_LINECARD_GET,
@@ -5418,7 +5418,7 @@ static int cmd_sb_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SB_GET, flags);
@@ -5495,7 +5495,7 @@ static int cmd_sb_pool_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SB_POOL_GET, flags);
@@ -5580,7 +5580,7 @@ static int cmd_sb_port_pool_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SB_PORT_POOL_GET, flags);
@@ -5684,7 +5684,7 @@ static int cmd_sb_tc_bind_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SB_TC_POOL_BIND_GET, flags);
@@ -8354,7 +8354,7 @@ static int cmd_region_show(struct dl *dl)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_REGION_GET, flags);
@@ -9024,7 +9024,7 @@ static int __cmd_health_show(struct dl *dl, bool show_device, bool show_port)
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_HEALTH_REPORTER_GET,
flags);
@@ -9216,7 +9216,7 @@ static int cmd_trap_show(struct dl *dl)
struct nlmsghdr *nlh;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_TRAP_GET, flags);
@@ -9291,7 +9291,7 @@ static int cmd_trap_group_show(struct dl *dl)
struct nlmsghdr *nlh;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_TRAP_GROUP_GET, flags);
@@ -9388,7 +9388,7 @@ static int cmd_trap_policer_show(struct dl *dl)
struct nlmsghdr *nlh;
int err;
- if (dl_argc(dl) == 0)
+ if (dl_no_arg(dl))
flags |= NLM_F_DUMP;
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_TRAP_POLICER_GET, flags);
Use the helper dl_no_arg function to check for whether the command has any arguments. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- devlink/devlink.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)