aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
authorKamal Heib <kamalheib1@gmail.com>2019-08-07 13:31:35 +0300
committerDoug Ledford <dledford@redhat.com>2019-08-12 10:18:52 -0400
commit72a7720fca37fec0daf295923f17ac5d88a613e1 (patch)
tree83e582ce1eb8063de2e3e98c216853f5e636b4e9 /drivers/infiniband/hw/mlx4
parentRDMA/efa: Rate limit admin queue error prints (diff)
downloadlinux-dev-72a7720fca37fec0daf295923f17ac5d88a613e1.tar.xz
linux-dev-72a7720fca37fec0daf295923f17ac5d88a613e1.zip
RDMA: Introduce ib_port_phys_state enum
In order to improve readability, add ib_port_phys_state enum to replace the use of magic numbers. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Reviewed-by: Andrew Boyer <aboyer@tobark.org> Acked-by: Michal Kalderon <michal.kalderon@marvell.com> Acked-by: Bernard Metzler <bmt@zurich.ibm.com> Link: https://lore.kernel.org/r/20190807103138.17219-2-kamalheib1@gmail.com Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 8790101facb7..8d2f1e38b891 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -734,7 +734,8 @@ out:
static u8 state_to_phys_state(enum ib_port_state state)
{
- return state == IB_PORT_ACTIVE ? 5 : 3;
+ return state == IB_PORT_ACTIVE ?
+ IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
}
static int eth_link_query_port(struct ib_device *ibdev, u8 port,