]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Merge branch 'iproute2-master' into iproute2-next
authorDavid Ahern <dsahern@gmail.com>
Sat, 24 Nov 2018 15:06:11 +0000 (07:06 -0800)
committerDavid Ahern <dsahern@gmail.com>
Sat, 24 Nov 2018 15:06:11 +0000 (07:06 -0800)
Signed-off-by: David Ahern <dsahern@gmail.com>
1  2 
rdma/rdma.h
rdma/utils.c

diff --combined rdma/rdma.h
index 547bb5749a39f68e7237f976ee57518f3e7aa21d,05c3c69b07fd42a8aadf084e48d646d0a05b06a3..42be91748c15c323b89506b2eb8b40cb43ac734a
@@@ -74,13 -74,6 +74,6 @@@ struct rd_cmd 
        int (*func)(struct rd *rd);
  };
  
- /*
-  * Parser interface
-  */
- bool rd_no_arg(struct rd *rd);
- void rd_arg_inc(struct rd *rd);
- char *rd_argv(struct rd *rd);
  
  /*
   * Commands interface
@@@ -90,14 -83,11 +83,12 @@@ int cmd_link(struct rd *rd)
  int cmd_res(struct rd *rd);
  int rd_exec_cmd(struct rd *rd, const struct rd_cmd *c, const char *str);
  int rd_exec_dev(struct rd *rd, int (*cb)(struct rd *rd));
 +int rd_exec_require_dev(struct rd *rd, int (*cb)(struct rd *rd));
  int rd_exec_link(struct rd *rd, int (*cb)(struct rd *rd), bool strict_port);
  void rd_free(struct rd *rd);
  int rd_set_arg_to_devname(struct rd *rd);
  int rd_argc(struct rd *rd);
  
- int strcmpx(const char *str1, const char *str2);
  /*
   * Device manipulation
   */
@@@ -118,14 -108,12 +109,12 @@@ int rd_recv_msg(struct rd *rd, mnl_cb_
  void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags);
  int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data);
  int rd_attr_cb(const struct nlattr *attr, void *data);
- int rd_attr_check(const struct nlattr *attr, int *typep);
  
  /*
   * Print helpers
   */
  void print_driver_table(struct rd *rd, struct nlattr *tb);
  void newline(struct rd *rd);
- void newline_indent(struct rd *rd);
  #define MAX_LINE_LENGTH 80
  
  #endif /* _RDMA_TOOL_H_ */
diff --combined rdma/utils.c
index 61f4aeb1bcf27ca5c345e152d1b8501c7c487310,1a0cf56800d4c54ce31dbef2bb6227ab39e7e04c..696b69a4cc6fc1b664324bdd7d4830a0ccc9864e
@@@ -18,14 -18,14 +18,14 @@@ int rd_argc(struct rd *rd
        return rd->argc;
  }
  
- char *rd_argv(struct rd *rd)
static char *rd_argv(struct rd *rd)
  {
        if (!rd_argc(rd))
                return NULL;
        return *rd->argv;
  }
  
- int strcmpx(const char *str1, const char *str2)
static int strcmpx(const char *str1, const char *str2)
  {
        if (strlen(str1) > strlen(str2))
                return -1;
@@@ -39,7 -39,7 +39,7 @@@ static bool rd_argv_match(struct rd *rd
        return strcmpx(rd_argv(rd), pattern) == 0;
  }
  
- void rd_arg_inc(struct rd *rd)
static void rd_arg_inc(struct rd *rd)
  {
        if (!rd_argc(rd))
                return;
@@@ -47,7 -47,7 +47,7 @@@
        rd->argv++;
  }
  
- bool rd_no_arg(struct rd *rd)
static bool rd_no_arg(struct rd *rd)
  {
        return rd_argc(rd) == 0;
  }
@@@ -404,7 -404,7 +404,7 @@@ static const enum mnl_attr_data_type nl
        [RDMA_NLDEV_ATTR_DRIVER_U64] = MNL_TYPE_U64,
  };
  
- int rd_attr_check(const struct nlattr *attr, int *typep)
static int rd_attr_check(const struct nlattr *attr, int *typep)
  {
        int type;
  
@@@ -577,16 -577,6 +577,16 @@@ out
        return ret;
  }
  
 +int rd_exec_require_dev(struct rd *rd, int (*cb)(struct rd *rd))
 +{
 +      if (rd_no_arg(rd)) {
 +              pr_err("Please provide device name.\n");
 +              return -EINVAL;
 +      }
 +
 +      return rd_exec_dev(rd, cb);
 +}
 +
  int rd_exec_cmd(struct rd *rd, const struct rd_cmd *cmds, const char *str)
  {
        const struct rd_cmd *c;
@@@ -706,7 -696,7 +706,7 @@@ void newline(struct rd *rd
                pr_out("\n");
  }
  
- void newline_indent(struct rd *rd)
static void newline_indent(struct rd *rd)
  {
        newline(rd);
        if (!rd->json_output)