diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2017-08-17 15:50:38 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-24 16:27:10 -0400 |
commit | cdc596d89e39521cf412209a19b8baeb8d788cdc (patch) | |
tree | 21292213c0be108bd31836f0f0a5639d58e393a3 /drivers/infiniband/core/verbs.c | |
parent | 78b57f9529225111b440e6e5150f52f5d44e3c60 (diff) | |
download | linux-cdc596d89e39521cf412209a19b8baeb8d788cdc.tar.bz2 |
RDMA/core: Delete BUG() from unreachable flow
Remove call to BUG() in case wrong node_type was provided.
This flow is unreachable, because node_types are supplied
from specific enum.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 6a7cbc1540aa..4c1485e01c83 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -180,21 +180,15 @@ EXPORT_SYMBOL(ib_rate_to_mbps); __attribute_const__ enum rdma_transport_type rdma_node_get_transport(enum rdma_node_type node_type) { - switch (node_type) { - case RDMA_NODE_IB_CA: - case RDMA_NODE_IB_SWITCH: - case RDMA_NODE_IB_ROUTER: - return RDMA_TRANSPORT_IB; - case RDMA_NODE_RNIC: - return RDMA_TRANSPORT_IWARP; - case RDMA_NODE_USNIC: + + if (node_type == RDMA_NODE_USNIC) return RDMA_TRANSPORT_USNIC; - case RDMA_NODE_USNIC_UDP: + if (node_type == RDMA_NODE_USNIC_UDP) return RDMA_TRANSPORT_USNIC_UDP; - default: - BUG(); - return 0; - } + if (node_type == RDMA_NODE_RNIC) + return RDMA_TRANSPORT_IWARP; + + return RDMA_TRANSPORT_IB; } EXPORT_SYMBOL(rdma_node_get_transport); |