diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2009-01-17 20:11:57 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-01-17 20:11:57 -0500 |
commit | 9c3da0991754d480328eeaa2b90cb231a1cea9b6 (patch) | |
tree | 744f69e5b04af0e950658fb26ad95bd18868c8e8 /drivers/infiniband/core | |
parent | f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b (diff) |
IB: Remove __constant_{endian} uses
The base versions handle constant folding just fine, use them
directly. The replacements are OK in the include/ files as they are
not exported to userspace so we don't need the __ prefixed versions.
This patch does not affect code generation at all.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/cm.c | 15 | ||||
-rw-r--r-- | drivers/infiniband/core/cm_msgs.h | 22 | ||||
-rw-r--r-- | drivers/infiniband/core/mad_rmpp.c | 2 |
3 files changed, 19 insertions, 20 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index f1e82a92e61e..5130fc55b8e2 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c | |||
@@ -927,8 +927,7 @@ int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask, | |||
927 | unsigned long flags; | 927 | unsigned long flags; |
928 | int ret = 0; | 928 | int ret = 0; |
929 | 929 | ||
930 | service_mask = service_mask ? service_mask : | 930 | service_mask = service_mask ? service_mask : ~cpu_to_be64(0); |
931 | __constant_cpu_to_be64(~0ULL); | ||
932 | service_id &= service_mask; | 931 | service_id &= service_mask; |
933 | if ((service_id & IB_SERVICE_ID_AGN_MASK) == IB_CM_ASSIGN_SERVICE_ID && | 932 | if ((service_id & IB_SERVICE_ID_AGN_MASK) == IB_CM_ASSIGN_SERVICE_ID && |
934 | (service_id != IB_CM_ASSIGN_SERVICE_ID)) | 933 | (service_id != IB_CM_ASSIGN_SERVICE_ID)) |
@@ -954,7 +953,7 @@ int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask, | |||
954 | spin_lock_irqsave(&cm.lock, flags); | 953 | spin_lock_irqsave(&cm.lock, flags); |
955 | if (service_id == IB_CM_ASSIGN_SERVICE_ID) { | 954 | if (service_id == IB_CM_ASSIGN_SERVICE_ID) { |
956 | cm_id->service_id = cpu_to_be64(cm.listen_service_id++); | 955 | cm_id->service_id = cpu_to_be64(cm.listen_service_id++); |
957 | cm_id->service_mask = __constant_cpu_to_be64(~0ULL); | 956 | cm_id->service_mask = ~cpu_to_be64(0); |
958 | } else { | 957 | } else { |
959 | cm_id->service_id = service_id; | 958 | cm_id->service_id = service_id; |
960 | cm_id->service_mask = service_mask; | 959 | cm_id->service_mask = service_mask; |
@@ -1134,7 +1133,7 @@ int ib_send_cm_req(struct ib_cm_id *cm_id, | |||
1134 | goto error1; | 1133 | goto error1; |
1135 | } | 1134 | } |
1136 | cm_id->service_id = param->service_id; | 1135 | cm_id->service_id = param->service_id; |
1137 | cm_id->service_mask = __constant_cpu_to_be64(~0ULL); | 1136 | cm_id->service_mask = ~cpu_to_be64(0); |
1138 | cm_id_priv->timeout_ms = cm_convert_to_ms( | 1137 | cm_id_priv->timeout_ms = cm_convert_to_ms( |
1139 | param->primary_path->packet_life_time) * 2 + | 1138 | param->primary_path->packet_life_time) * 2 + |
1140 | cm_convert_to_ms( | 1139 | cm_convert_to_ms( |
@@ -1545,7 +1544,7 @@ static int cm_req_handler(struct cm_work *work) | |||
1545 | cm_id_priv->id.cm_handler = listen_cm_id_priv->id.cm_handler; | 1544 | cm_id_priv->id.cm_handler = listen_cm_id_priv->id.cm_handler; |
1546 | cm_id_priv->id.context = listen_cm_id_priv->id.context; | 1545 | cm_id_priv->id.context = listen_cm_id_priv->id.context; |
1547 | cm_id_priv->id.service_id = req_msg->service_id; | 1546 | cm_id_priv->id.service_id = req_msg->service_id; |
1548 | cm_id_priv->id.service_mask = __constant_cpu_to_be64(~0ULL); | 1547 | cm_id_priv->id.service_mask = ~cpu_to_be64(0); |
1549 | 1548 | ||
1550 | cm_process_routed_req(req_msg, work->mad_recv_wc->wc); | 1549 | cm_process_routed_req(req_msg, work->mad_recv_wc->wc); |
1551 | cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]); | 1550 | cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]); |
@@ -2898,7 +2897,7 @@ int ib_send_cm_sidr_req(struct ib_cm_id *cm_id, | |||
2898 | goto out; | 2897 | goto out; |
2899 | 2898 | ||
2900 | cm_id->service_id = param->service_id; | 2899 | cm_id->service_id = param->service_id; |
2901 | cm_id->service_mask = __constant_cpu_to_be64(~0ULL); | 2900 | cm_id->service_mask = ~cpu_to_be64(0); |
2902 | cm_id_priv->timeout_ms = param->timeout_ms; | 2901 | cm_id_priv->timeout_ms = param->timeout_ms; |
2903 | cm_id_priv->max_cm_retries = param->max_cm_retries; | 2902 | cm_id_priv->max_cm_retries = param->max_cm_retries; |
2904 | ret = cm_alloc_msg(cm_id_priv, &msg); | 2903 | ret = cm_alloc_msg(cm_id_priv, &msg); |
@@ -2992,7 +2991,7 @@ static int cm_sidr_req_handler(struct cm_work *work) | |||
2992 | cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler; | 2991 | cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler; |
2993 | cm_id_priv->id.context = cur_cm_id_priv->id.context; | 2992 | cm_id_priv->id.context = cur_cm_id_priv->id.context; |
2994 | cm_id_priv->id.service_id = sidr_req_msg->service_id; | 2993 | cm_id_priv->id.service_id = sidr_req_msg->service_id; |
2995 | cm_id_priv->id.service_mask = __constant_cpu_to_be64(~0ULL); | 2994 | cm_id_priv->id.service_mask = ~cpu_to_be64(0); |
2996 | 2995 | ||
2997 | cm_format_sidr_req_event(work, &cur_cm_id_priv->id); | 2996 | cm_format_sidr_req_event(work, &cur_cm_id_priv->id); |
2998 | cm_process_work(cm_id_priv, work); | 2997 | cm_process_work(cm_id_priv, work); |
@@ -3789,7 +3788,7 @@ static int __init ib_cm_init(void) | |||
3789 | rwlock_init(&cm.device_lock); | 3788 | rwlock_init(&cm.device_lock); |
3790 | spin_lock_init(&cm.lock); | 3789 | spin_lock_init(&cm.lock); |
3791 | cm.listen_service_table = RB_ROOT; | 3790 | cm.listen_service_table = RB_ROOT; |
3792 | cm.listen_service_id = __constant_be64_to_cpu(IB_CM_ASSIGN_SERVICE_ID); | 3791 | cm.listen_service_id = be64_to_cpu(IB_CM_ASSIGN_SERVICE_ID); |
3793 | cm.remote_id_table = RB_ROOT; | 3792 | cm.remote_id_table = RB_ROOT; |
3794 | cm.remote_qp_table = RB_ROOT; | 3793 | cm.remote_qp_table = RB_ROOT; |
3795 | cm.remote_sidr_table = RB_ROOT; | 3794 | cm.remote_sidr_table = RB_ROOT; |
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index aec9c7af825d..7e63c08f697c 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h | |||
@@ -44,17 +44,17 @@ | |||
44 | 44 | ||
45 | #define IB_CM_CLASS_VERSION 2 /* IB specification 1.2 */ | 45 | #define IB_CM_CLASS_VERSION 2 /* IB specification 1.2 */ |
46 | 46 | ||
47 | #define CM_REQ_ATTR_ID __constant_htons(0x0010) | 47 | #define CM_REQ_ATTR_ID cpu_to_be16(0x0010) |
48 | #define CM_MRA_ATTR_ID __constant_htons(0x0011) | 48 | #define CM_MRA_ATTR_ID cpu_to_be16(0x0011) |
49 | #define CM_REJ_ATTR_ID __constant_htons(0x0012) | 49 | #define CM_REJ_ATTR_ID cpu_to_be16(0x0012) |
50 | #define CM_REP_ATTR_ID __constant_htons(0x0013) | 50 | #define CM_REP_ATTR_ID cpu_to_be16(0x0013) |
51 | #define CM_RTU_ATTR_ID __constant_htons(0x0014) | 51 | #define CM_RTU_ATTR_ID cpu_to_be16(0x0014) |
52 | #define CM_DREQ_ATTR_ID __constant_htons(0x0015) | 52 | #define CM_DREQ_ATTR_ID cpu_to_be16(0x0015) |
53 | #define CM_DREP_ATTR_ID __constant_htons(0x0016) | 53 | #define CM_DREP_ATTR_ID cpu_to_be16(0x0016) |
54 | #define CM_SIDR_REQ_ATTR_ID __constant_htons(0x0017) | 54 | #define CM_SIDR_REQ_ATTR_ID cpu_to_be16(0x0017) |
55 | #define CM_SIDR_REP_ATTR_ID __constant_htons(0x0018) | 55 | #define CM_SIDR_REP_ATTR_ID cpu_to_be16(0x0018) |
56 | #define CM_LAP_ATTR_ID __constant_htons(0x0019) | 56 | #define CM_LAP_ATTR_ID cpu_to_be16(0x0019) |
57 | #define CM_APR_ATTR_ID __constant_htons(0x001A) | 57 | #define CM_APR_ATTR_ID cpu_to_be16(0x001A) |
58 | 58 | ||
59 | enum cm_msg_sequence { | 59 | enum cm_msg_sequence { |
60 | CM_MSG_SEQUENCE_REQ, | 60 | CM_MSG_SEQUENCE_REQ, |
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 3af2b84cd838..57a3c6f947b2 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -735,7 +735,7 @@ process_rmpp_data(struct ib_mad_agent_private *agent, | |||
735 | goto bad; | 735 | goto bad; |
736 | } | 736 | } |
737 | 737 | ||
738 | if (rmpp_hdr->seg_num == __constant_htonl(1)) { | 738 | if (rmpp_hdr->seg_num == cpu_to_be32(1)) { |
739 | if (!(ib_get_rmpp_flags(rmpp_hdr) & IB_MGMT_RMPP_FLAG_FIRST)) { | 739 | if (!(ib_get_rmpp_flags(rmpp_hdr) & IB_MGMT_RMPP_FLAG_FIRST)) { |
740 | rmpp_status = IB_MGMT_RMPP_STATUS_BAD_SEG; | 740 | rmpp_status = IB_MGMT_RMPP_STATUS_BAD_SEG; |
741 | goto bad; | 741 | goto bad; |