diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2017-10-06 13:06:17 -0700 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-10-10 10:49:44 -0400 |
commit | 9d18717790c43c904fabe9da7a4c6b2ebed2c4d8 (patch) | |
tree | de8c28625958592b5015d30c0c2101d5f7508b07 /drivers/infiniband/core/uverbs_marshall.c | |
parent | 9cc12ad6db55d7d902260fead28a91710dd5dbe5 (diff) | |
download | linux-stable-9d18717790c43c904fabe9da7a4c6b2ebed2c4d8.tar.gz linux-stable-9d18717790c43c904fabe9da7a4c6b2ebed2c4d8.tar.bz2 linux-stable-9d18717790c43c904fabe9da7a4c6b2ebed2c4d8.zip |
IB/core: Simplify sa_path_set_[sd]lid() calls
Instead of making every caller convert the second argument of
sa_path_set_slid() and sa_path_set_dlid() to big endian format,
make these two functions accept LIDs in CPU endian format.
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Cc: Don Hiatt <don.hiatt@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_marshall.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_marshall.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c index bd0acf376af0..aeb2824efbc7 100644 --- a/drivers/infiniband/core/uverbs_marshall.c +++ b/drivers/infiniband/core/uverbs_marshall.c @@ -176,18 +176,18 @@ EXPORT_SYMBOL(ib_copy_path_rec_to_user); void ib_copy_path_rec_from_user(struct sa_path_rec *dst, struct ib_user_path_rec *src) { - __be32 slid, dlid; + u32 slid, dlid; memset(dst, 0, sizeof(*dst)); if ((ib_is_opa_gid((union ib_gid *)src->sgid)) || (ib_is_opa_gid((union ib_gid *)src->dgid))) { dst->rec_type = SA_PATH_REC_TYPE_OPA; - slid = htonl(opa_get_lid_from_gid((union ib_gid *)src->sgid)); - dlid = htonl(opa_get_lid_from_gid((union ib_gid *)src->dgid)); + slid = opa_get_lid_from_gid((union ib_gid *)src->sgid); + dlid = opa_get_lid_from_gid((union ib_gid *)src->dgid); } else { dst->rec_type = SA_PATH_REC_TYPE_IB; - slid = htonl(ntohs(src->slid)); - dlid = htonl(ntohs(src->dlid)); + slid = ntohs(src->slid); + dlid = ntohs(src->dlid); } memcpy(dst->dgid.raw, src->dgid, sizeof dst->dgid); memcpy(dst->sgid.raw, src->sgid, sizeof dst->sgid); |