aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2013-02-25 12:02:03 -0500
committerRoland Dreier <roland@purestorage.com>2013-02-25 12:02:03 -0500
commita29bec12412d0e6f18ef1ce5f535e39829038648 (patch)
tree11247ce903015b44492ac10778ef7f3bc8e6ee5b /drivers/infiniband
parent61083720702a329ed5952e32bda384e3bbc9093c (diff)
IB/mlx4: Convert is_xxx variables in build_mlx_header() to bool
Matches the way they're used, and actually lets at least x86-64 generate better code: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-38 (-38) function old new delta mlx4_ib_post_send 4416 4378 -38 Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h4
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index dcd845bc30f0..cce5dde94bc1 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -652,12 +652,12 @@ int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
652int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr, 652int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr,
653 u8 *mac, int *is_mcast, u8 port); 653 u8 *mac, int *is_mcast, u8 port);
654 654
655static inline int mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah) 655static inline bool mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah)
656{ 656{
657 u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3; 657 u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3;
658 658
659 if (rdma_port_get_link_layer(ah->ibah.device, port) == IB_LINK_LAYER_ETHERNET) 659 if (rdma_port_get_link_layer(ah->ibah.device, port) == IB_LINK_LAYER_ETHERNET)
660 return 1; 660 return true;
661 661
662 return !!(ah->av.ib.g_slid & 0x80); 662 return !!(ah->av.ib.g_slid & 0x80);
663} 663}
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index c6dde71b4642..f8ac5333504d 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1746,11 +1746,11 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1746 int header_size; 1746 int header_size;
1747 int spc; 1747 int spc;
1748 int i; 1748 int i;
1749 int is_eth;
1750 int is_vlan = 0;
1751 int is_grh;
1752 u16 vlan;
1753 int err = 0; 1749 int err = 0;
1750 u16 vlan;
1751 bool is_eth;
1752 bool is_vlan = false;
1753 bool is_grh;
1754 1754
1755 send_size = 0; 1755 send_size = 0;
1756 for (i = 0; i < wr->num_sge; ++i) 1756 for (i = 0; i < wr->num_sge; ++i)