RDMA/uverbs: Make all the method functions in uverbs_cmd static
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 12 Nov 2018 20:59:57 +0000 (22:59 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 22 Nov 2018 18:57:33 +0000 (11:57 -0700)
Now that we use struct uverbs_uapi to link the method functions to the
dispatcher there is no reason to have them be extern symbols.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_cmd.c

index f5bc99e..8b41c95 100644 (file)
@@ -294,63 +294,4 @@ extern const struct uverbs_object_def UVERBS_OBJECT(UVERBS_OBJECT_FLOW_ACTION);
 extern const struct uverbs_object_def UVERBS_OBJECT(UVERBS_OBJECT_DM);
 extern const struct uverbs_object_def UVERBS_OBJECT(UVERBS_OBJECT_COUNTERS);
 
-#define IB_UVERBS_DECLARE_CMD(name)                                    \
-       ssize_t ib_uverbs_##name(struct ib_uverbs_file *file,           \
-                                const char __user *buf, int in_len,    \
-                                int out_len)
-
-IB_UVERBS_DECLARE_CMD(get_context);
-IB_UVERBS_DECLARE_CMD(query_device);
-IB_UVERBS_DECLARE_CMD(query_port);
-IB_UVERBS_DECLARE_CMD(alloc_pd);
-IB_UVERBS_DECLARE_CMD(dealloc_pd);
-IB_UVERBS_DECLARE_CMD(reg_mr);
-IB_UVERBS_DECLARE_CMD(rereg_mr);
-IB_UVERBS_DECLARE_CMD(dereg_mr);
-IB_UVERBS_DECLARE_CMD(alloc_mw);
-IB_UVERBS_DECLARE_CMD(dealloc_mw);
-IB_UVERBS_DECLARE_CMD(create_comp_channel);
-IB_UVERBS_DECLARE_CMD(create_cq);
-IB_UVERBS_DECLARE_CMD(resize_cq);
-IB_UVERBS_DECLARE_CMD(poll_cq);
-IB_UVERBS_DECLARE_CMD(req_notify_cq);
-IB_UVERBS_DECLARE_CMD(destroy_cq);
-IB_UVERBS_DECLARE_CMD(create_qp);
-IB_UVERBS_DECLARE_CMD(open_qp);
-IB_UVERBS_DECLARE_CMD(query_qp);
-IB_UVERBS_DECLARE_CMD(modify_qp);
-IB_UVERBS_DECLARE_CMD(destroy_qp);
-IB_UVERBS_DECLARE_CMD(post_send);
-IB_UVERBS_DECLARE_CMD(post_recv);
-IB_UVERBS_DECLARE_CMD(post_srq_recv);
-IB_UVERBS_DECLARE_CMD(create_ah);
-IB_UVERBS_DECLARE_CMD(destroy_ah);
-IB_UVERBS_DECLARE_CMD(attach_mcast);
-IB_UVERBS_DECLARE_CMD(detach_mcast);
-IB_UVERBS_DECLARE_CMD(create_srq);
-IB_UVERBS_DECLARE_CMD(modify_srq);
-IB_UVERBS_DECLARE_CMD(query_srq);
-IB_UVERBS_DECLARE_CMD(destroy_srq);
-IB_UVERBS_DECLARE_CMD(create_xsrq);
-IB_UVERBS_DECLARE_CMD(open_xrcd);
-IB_UVERBS_DECLARE_CMD(close_xrcd);
-
-#define IB_UVERBS_DECLARE_EX_CMD(name)                         \
-       int ib_uverbs_ex_##name(struct ib_uverbs_file *file,    \
-                               struct ib_udata *ucore,         \
-                               struct ib_udata *uhw)
-
-IB_UVERBS_DECLARE_EX_CMD(create_flow);
-IB_UVERBS_DECLARE_EX_CMD(destroy_flow);
-IB_UVERBS_DECLARE_EX_CMD(query_device);
-IB_UVERBS_DECLARE_EX_CMD(create_cq);
-IB_UVERBS_DECLARE_EX_CMD(create_qp);
-IB_UVERBS_DECLARE_EX_CMD(create_wq);
-IB_UVERBS_DECLARE_EX_CMD(modify_wq);
-IB_UVERBS_DECLARE_EX_CMD(destroy_wq);
-IB_UVERBS_DECLARE_EX_CMD(create_rwq_ind_table);
-IB_UVERBS_DECLARE_EX_CMD(destroy_rwq_ind_table);
-IB_UVERBS_DECLARE_EX_CMD(modify_qp);
-IB_UVERBS_DECLARE_EX_CMD(modify_cq);
-
 #endif /* UVERBS_H */
index e825142..7c7ec15 100644 (file)
@@ -65,9 +65,9 @@ _ib_uverbs_lookup_comp_file(s32 fd, struct ib_uverbs_file *ufile)
 #define ib_uverbs_lookup_comp_file(_fd, _ufile)                                \
        _ib_uverbs_lookup_comp_file((_fd)*typecheck(s32, _fd), _ufile)
 
-ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
-                             const char __user *buf,
-                             int in_len, int out_len)
+static ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
+                                    const char __user *buf, int in_len,
+                                    int out_len)
 {
        struct ib_uverbs_get_context      cmd;
        struct ib_uverbs_get_context_resp resp;
@@ -224,9 +224,9 @@ static void copy_query_dev_fields(struct ib_ucontext *ucontext,
        resp->phys_port_cnt             = ib_dev->phys_port_cnt;
 }
 
-ssize_t ib_uverbs_query_device(struct ib_uverbs_file *file,
-                              const char __user *buf,
-                              int in_len, int out_len)
+static ssize_t ib_uverbs_query_device(struct ib_uverbs_file *file,
+                                     const char __user *buf, int in_len,
+                                     int out_len)
 {
        struct ib_uverbs_query_device      cmd;
        struct ib_uverbs_query_device_resp resp;
@@ -272,9 +272,9 @@ static u32 make_port_cap_flags(const struct ib_port_attr *attr)
        return res;
 }
 
-ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
-                            const char __user *buf,
-                            int in_len, int out_len)
+static ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_query_port      cmd;
        struct ib_uverbs_query_port_resp resp;
@@ -337,9 +337,9 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
        return in_len;
 }
 
-ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
-                          const char __user *buf,
-                          int in_len, int out_len)
+static ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
+                                 const char __user *buf, int in_len,
+                                 int out_len)
 {
        struct ib_uverbs_alloc_pd      cmd;
        struct ib_uverbs_alloc_pd_resp resp;
@@ -396,9 +396,9 @@ err:
        return ret;
 }
 
-ssize_t ib_uverbs_dealloc_pd(struct ib_uverbs_file *file,
-                            const char __user *buf,
-                            int in_len, int out_len)
+static ssize_t ib_uverbs_dealloc_pd(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_dealloc_pd cmd;
 
@@ -494,9 +494,9 @@ static void xrcd_table_delete(struct ib_uverbs_device *dev,
        }
 }
 
-ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_open_xrcd      cmd;
        struct ib_uverbs_open_xrcd_resp resp;
@@ -615,9 +615,9 @@ err_tree_mutex_unlock:
        return ret;
 }
 
-ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_close_xrcd cmd;
 
@@ -653,9 +653,8 @@ int ib_uverbs_dealloc_xrcd(struct ib_uobject *uobject,
        return ret;
 }
 
-ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
-                        const char __user *buf, int in_len,
-                        int out_len)
+static ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
+                               const char __user *buf, int in_len, int out_len)
 {
        struct ib_uverbs_reg_mr      cmd;
        struct ib_uverbs_reg_mr_resp resp;
@@ -745,9 +744,9 @@ err_free:
        return ret;
 }
 
-ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file,
-                          const char __user *buf, int in_len,
-                          int out_len)
+static ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file,
+                                 const char __user *buf, int in_len,
+                                 int out_len)
 {
        struct ib_uverbs_rereg_mr      cmd;
        struct ib_uverbs_rereg_mr_resp resp;
@@ -836,9 +835,9 @@ put_uobjs:
        return ret;
 }
 
-ssize_t ib_uverbs_dereg_mr(struct ib_uverbs_file *file,
-                          const char __user *buf, int in_len,
-                          int out_len)
+static ssize_t ib_uverbs_dereg_mr(struct ib_uverbs_file *file,
+                                 const char __user *buf, int in_len,
+                                 int out_len)
 {
        struct ib_uverbs_dereg_mr cmd;
 
@@ -849,9 +848,9 @@ ssize_t ib_uverbs_dereg_mr(struct ib_uverbs_file *file,
                                    in_len);
 }
 
-ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
-                          const char __user *buf, int in_len,
-                          int out_len)
+static ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
+                                 const char __user *buf, int in_len,
+                                 int out_len)
 {
        struct ib_uverbs_alloc_mw      cmd;
        struct ib_uverbs_alloc_mw_resp resp;
@@ -917,9 +916,9 @@ err_free:
        return ret;
 }
 
-ssize_t ib_uverbs_dealloc_mw(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_dealloc_mw(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_dealloc_mw cmd;
 
@@ -930,9 +929,9 @@ ssize_t ib_uverbs_dealloc_mw(struct ib_uverbs_file *file,
                                    in_len);
 }
 
-ssize_t ib_uverbs_create_comp_channel(struct ib_uverbs_file *file,
-                                     const char __user *buf, int in_len,
-                                     int out_len)
+static ssize_t ib_uverbs_create_comp_channel(struct ib_uverbs_file *file,
+                                            const char __user *buf, int in_len,
+                                            int out_len)
 {
        struct ib_uverbs_create_comp_channel       cmd;
        struct ib_uverbs_create_comp_channel_resp  resp;
@@ -1074,9 +1073,9 @@ static int ib_uverbs_create_cq_cb(struct ib_uverbs_file *file,
        return 0;
 }
 
-ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_create_cq      cmd;
        struct ib_uverbs_ex_create_cq   cmd_ex;
@@ -1127,9 +1126,8 @@ static int ib_uverbs_ex_create_cq_cb(struct ib_uverbs_file *file,
        return 0;
 }
 
-int ib_uverbs_ex_create_cq(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_create_cq(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_create_cq_resp resp;
        struct ib_uverbs_ex_create_cq  cmd;
@@ -1160,9 +1158,9 @@ int ib_uverbs_ex_create_cq(struct ib_uverbs_file *file,
        return PTR_ERR_OR_ZERO(obj);
 }
 
-ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_resize_cq      cmd;
        struct ib_uverbs_resize_cq_resp resp = {};
@@ -1227,9 +1225,9 @@ static int copy_wc_to_user(struct ib_device *ib_dev, void __user *dest,
        return 0;
 }
 
-ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file,
-                         const char __user *buf, int in_len,
-                         int out_len)
+static ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file,
+                                const char __user *buf, int in_len,
+                                int out_len)
 {
        struct ib_uverbs_poll_cq       cmd;
        struct ib_uverbs_poll_cq_resp  resp;
@@ -1278,9 +1276,9 @@ out_put:
        return ret;
 }
 
-ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file,
-                               const char __user *buf, int in_len,
-                               int out_len)
+static ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file,
+                                      const char __user *buf, int in_len,
+                                      int out_len)
 {
        struct ib_uverbs_req_notify_cq cmd;
        struct ib_cq                  *cq;
@@ -1300,9 +1298,9 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file,
        return in_len;
 }
 
-ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_destroy_cq      cmd;
        struct ib_uverbs_destroy_cq_resp resp;
@@ -1615,9 +1613,9 @@ static int ib_uverbs_create_qp_cb(struct ib_uverbs_file *file,
        return 0;
 }
 
-ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_create_qp      cmd;
        struct ib_uverbs_ex_create_qp   cmd_ex;
@@ -1675,9 +1673,8 @@ static int ib_uverbs_ex_create_qp_cb(struct ib_uverbs_file *file,
        return 0;
 }
 
-int ib_uverbs_ex_create_qp(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_create_qp(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_create_qp_resp resp;
        struct ib_uverbs_ex_create_qp cmd = {0};
@@ -1711,8 +1708,9 @@ int ib_uverbs_ex_create_qp(struct ib_uverbs_file *file,
        return 0;
 }
 
-ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,
-                         const char __user *buf, int in_len, int out_len)
+static ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,
+                                const char __user *buf, int in_len,
+                                int out_len)
 {
        struct ib_uverbs_open_qp        cmd;
        struct ib_uverbs_create_qp_resp resp;
@@ -1818,9 +1816,9 @@ static void copy_ah_attr_to_uverbs(struct ib_uverbs_qp_dest *uverb_attr,
        uverb_attr->port_num          = rdma_ah_get_port_num(rdma_attr);
 }
 
-ssize_t ib_uverbs_query_qp(struct ib_uverbs_file *file,
-                          const char __user *buf, int in_len,
-                          int out_len)
+static ssize_t ib_uverbs_query_qp(struct ib_uverbs_file *file,
+                                 const char __user *buf, int in_len,
+                                 int out_len)
 {
        struct ib_uverbs_query_qp      cmd;
        struct ib_uverbs_query_qp_resp resp;
@@ -2091,9 +2089,9 @@ out:
        return ret;
 }
 
-ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_ex_modify_qp cmd = {};
        struct ib_udata udata;
@@ -2117,9 +2115,8 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
        return in_len;
 }
 
-int ib_uverbs_ex_modify_qp(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_modify_qp(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_modify_qp cmd = {};
        int ret;
@@ -2152,9 +2149,9 @@ int ib_uverbs_ex_modify_qp(struct ib_uverbs_file *file,
        return ret;
 }
 
-ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_destroy_qp      cmd;
        struct ib_uverbs_destroy_qp_resp resp;
@@ -2190,9 +2187,9 @@ static void *alloc_wr(size_t wr_size, __u32 num_sge)
                         num_sge * sizeof (struct ib_sge), GFP_KERNEL);
 }
 
-ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_post_send      cmd;
        struct ib_uverbs_post_send_resp resp;
@@ -2470,9 +2467,9 @@ err:
        return ERR_PTR(ret);
 }
 
-ssize_t ib_uverbs_post_recv(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_post_recv(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_post_recv      cmd;
        struct ib_uverbs_post_recv_resp resp;
@@ -2519,9 +2516,9 @@ out:
        return ret ? ret : in_len;
 }
 
-ssize_t ib_uverbs_post_srq_recv(struct ib_uverbs_file *file,
-                               const char __user *buf, int in_len,
-                               int out_len)
+static ssize_t ib_uverbs_post_srq_recv(struct ib_uverbs_file *file,
+                                      const char __user *buf, int in_len,
+                                      int out_len)
 {
        struct ib_uverbs_post_srq_recv      cmd;
        struct ib_uverbs_post_srq_recv_resp resp;
@@ -2569,9 +2566,9 @@ out:
        return ret ? ret : in_len;
 }
 
-ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
-                           const char __user *buf, int in_len,
-                           int out_len)
+static ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_create_ah       cmd;
        struct ib_uverbs_create_ah_resp  resp;
@@ -2658,8 +2655,9 @@ err:
        return ret;
 }
 
-ssize_t ib_uverbs_destroy_ah(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len, int out_len)
+static ssize_t ib_uverbs_destroy_ah(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_destroy_ah cmd;
 
@@ -2670,9 +2668,9 @@ ssize_t ib_uverbs_destroy_ah(struct ib_uverbs_file *file,
                                    in_len);
 }
 
-ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file,
-                              const char __user *buf, int in_len,
-                              int out_len)
+static ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file,
+                                     const char __user *buf, int in_len,
+                                     int out_len)
 {
        struct ib_uverbs_attach_mcast cmd;
        struct ib_qp                 *qp;
@@ -2719,9 +2717,9 @@ out_put:
        return ret ? ret : in_len;
 }
 
-ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
-                              const char __user *buf, int in_len,
-                              int out_len)
+static ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
+                                     const char __user *buf, int in_len,
+                                     int out_len)
 {
        struct ib_uverbs_detach_mcast cmd;
        struct ib_uqp_object         *obj;
@@ -3081,9 +3079,8 @@ static int kern_spec_to_ib_spec(struct ib_uverbs_file *ufile,
                return kern_spec_to_ib_spec_filter(kern_spec, ib_spec);
 }
 
-int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_create_wq     cmd = {};
        struct ib_uverbs_ex_create_wq_resp resp = {};
@@ -3197,9 +3194,8 @@ err_uobj:
        return err;
 }
 
-int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
-                           struct ib_udata *ucore,
-                           struct ib_udata *uhw)
+static int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
+                                  struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_destroy_wq  cmd = {};
        struct ib_uverbs_ex_destroy_wq_resp     resp = {};
@@ -3243,9 +3239,8 @@ int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
        return ib_copy_to_udata(ucore, &resp, resp.response_length);
 }
 
-int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_modify_wq cmd = {};
        struct ib_wq *wq;
@@ -3292,9 +3287,9 @@ out:
        return ret;
 }
 
-int ib_uverbs_ex_create_rwq_ind_table(struct ib_uverbs_file *file,
-                                     struct ib_udata *ucore,
-                                     struct ib_udata *uhw)
+static int ib_uverbs_ex_create_rwq_ind_table(struct ib_uverbs_file *file,
+                                            struct ib_udata *ucore,
+                                            struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_create_rwq_ind_table          cmd = {};
        struct ib_uverbs_ex_create_rwq_ind_table_resp  resp = {};
@@ -3435,9 +3430,9 @@ err_free:
        return err;
 }
 
-int ib_uverbs_ex_destroy_rwq_ind_table(struct ib_uverbs_file *file,
-                                      struct ib_udata *ucore,
-                                      struct ib_udata *uhw)
+static int ib_uverbs_ex_destroy_rwq_ind_table(struct ib_uverbs_file *file,
+                                             struct ib_udata *ucore,
+                                             struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_destroy_rwq_ind_table       cmd = {};
        int                     ret;
@@ -3464,9 +3459,9 @@ int ib_uverbs_ex_destroy_rwq_ind_table(struct ib_uverbs_file *file,
                                    cmd.ind_tbl_handle, file, 0);
 }
 
-int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
-                            struct ib_udata *ucore,
-                            struct ib_udata *uhw)
+static int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
+                                   struct ib_udata *ucore,
+                                   struct ib_udata *uhw)
 {
        struct ib_uverbs_create_flow      cmd;
        struct ib_uverbs_create_flow_resp resp;
@@ -3642,9 +3637,9 @@ err_free_attr:
        return err;
 }
 
-int ib_uverbs_ex_destroy_flow(struct ib_uverbs_file *file,
-                             struct ib_udata *ucore,
-                             struct ib_udata *uhw)
+static int ib_uverbs_ex_destroy_flow(struct ib_uverbs_file *file,
+                                    struct ib_udata *ucore,
+                                    struct ib_udata *uhw)
 {
        struct ib_uverbs_destroy_flow   cmd;
        int                             ret;
@@ -3799,9 +3794,9 @@ err:
        return ret;
 }
 
-ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_create_srq      cmd;
        struct ib_uverbs_create_xsrq     xcmd;
@@ -3836,8 +3831,9 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
        return in_len;
 }
 
-ssize_t ib_uverbs_create_xsrq(struct ib_uverbs_file *file,
-                             const char __user *buf, int in_len, int out_len)
+static ssize_t ib_uverbs_create_xsrq(struct ib_uverbs_file *file,
+                                    const char __user *buf, int in_len,
+                                    int out_len)
 {
        struct ib_uverbs_create_xsrq     cmd;
        struct ib_uverbs_create_srq_resp resp;
@@ -3862,9 +3858,9 @@ ssize_t ib_uverbs_create_xsrq(struct ib_uverbs_file *file,
        return in_len;
 }
 
-ssize_t ib_uverbs_modify_srq(struct ib_uverbs_file *file,
-                            const char __user *buf, int in_len,
-                            int out_len)
+static ssize_t ib_uverbs_modify_srq(struct ib_uverbs_file *file,
+                                   const char __user *buf, int in_len,
+                                   int out_len)
 {
        struct ib_uverbs_modify_srq cmd;
        struct ib_udata             udata;
@@ -3892,9 +3888,9 @@ ssize_t ib_uverbs_modify_srq(struct ib_uverbs_file *file,
        return ret ? ret : in_len;
 }
 
-ssize_t ib_uverbs_query_srq(struct ib_uverbs_file *file,
-                           const char __user *buf,
-                           int in_len, int out_len)
+static ssize_t ib_uverbs_query_srq(struct ib_uverbs_file *file,
+                                  const char __user *buf, int in_len,
+                                  int out_len)
 {
        struct ib_uverbs_query_srq      cmd;
        struct ib_uverbs_query_srq_resp resp;
@@ -3931,9 +3927,9 @@ ssize_t ib_uverbs_query_srq(struct ib_uverbs_file *file,
        return in_len;
 }
 
-ssize_t ib_uverbs_destroy_srq(struct ib_uverbs_file *file,
-                             const char __user *buf, int in_len,
-                             int out_len)
+static ssize_t ib_uverbs_destroy_srq(struct ib_uverbs_file *file,
+                                    const char __user *buf, int in_len,
+                                    int out_len)
 {
        struct ib_uverbs_destroy_srq      cmd;
        struct ib_uverbs_destroy_srq_resp resp;
@@ -3959,9 +3955,9 @@ ssize_t ib_uverbs_destroy_srq(struct ib_uverbs_file *file,
        return in_len;
 }
 
-int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
-                             struct ib_udata *ucore,
-                             struct ib_udata *uhw)
+static int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
+                                    struct ib_udata *ucore,
+                                    struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_query_device_resp resp = { {0} };
        struct ib_uverbs_ex_query_device  cmd;
@@ -4086,9 +4082,8 @@ end:
        return err;
 }
 
-int ib_uverbs_ex_modify_cq(struct ib_uverbs_file *file,
-                          struct ib_udata *ucore,
-                          struct ib_udata *uhw)
+static int ib_uverbs_ex_modify_cq(struct ib_uverbs_file *file,
+                                 struct ib_udata *ucore, struct ib_udata *uhw)
 {
        struct ib_uverbs_ex_modify_cq cmd = {};
        struct ib_cq *cq;