IB/core: Use CONFIG_SECURITY_INFINIBAND to compile out security code
authorParav Pandit <parav@mellanox.com>
Thu, 26 Apr 2018 07:56:34 +0000 (10:56 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 1 May 2018 15:16:36 +0000 (11:16 -0400)
Make security.c depends on CONFIG_SECURITY_INFINIBAND.

Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/Makefile
drivers/infiniband/core/security.c

index dda9e856e3fa334d125d2ecdedadc42719197067..1cfedc469b23a1fb16f3b1dee02185a0ad05adad 100644 (file)
@@ -12,8 +12,9 @@ ib_core-y :=                  packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \
                                device.o fmr_pool.o cache.o netlink.o \
                                roce_gid_mgmt.o mr_pool.o addr.o sa_query.o \
                                multicast.o mad.o smi.o agent.o mad_rmpp.o \
-                               security.o nldev.o restrack.o
+                               nldev.o restrack.o
 
+ib_core-$(CONFIG_SECURITY_INFINIBAND) += security.o
 ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o
 ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o
 ib_core-$(CONFIG_CGROUP_RDMA) += cgroup.o
index b61dda6b04fc97fe4447988f2d50befae0e1221d..9b0bea8303e073c8983d2327d5fffc144b50e7ae 100644 (file)
@@ -30,8 +30,6 @@
  * SOFTWARE.
  */
 
-#ifdef CONFIG_SECURITY_INFINIBAND
-
 #include <linux/security.h>
 #include <linux/completion.h>
 #include <linux/list.h>
@@ -751,5 +749,3 @@ int ib_mad_enforce_security(struct ib_mad_agent_private *map, u16 pkey_index)
                                       pkey_index,
                                       map->agent.security);
 }
-
-#endif /* CONFIG_SECURITY_INFINIBAND */