Skip to content

Commit

Permalink
IB/hfi1: Move a function from a header file into a .c file
Browse files Browse the repository at this point in the history
Since ib_get_len() only has one caller, move it from a header file into a
.c file. Additionally, remove the superfluous u16 cast. That cast was
introduced by commit 7dafbab ("IB/hfi1: Add functions to parse BTH/IB
headers").

Link: https://lore.kernel.org/r/20210524041211.9480-2-bvanassche@acm.org
Cc: Don Hiatt <don.hiatt@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Bart Van Assche authored and Jason Gunthorpe committed May 28, 2021
1 parent 68e11a6 commit 17bb6b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/hw/hfi1/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ void hfi1_trace_parse_16b_bth(struct ib_other_headers *ohdr,
*qpn = ib_bth_get_qpn(ohdr);
}

static u16 ib_get_len(const struct ib_header *hdr)
{
return be16_to_cpu(hdr->lrh[2]);
}

void hfi1_trace_parse_9b_hdr(struct ib_header *hdr, bool sc5,
u8 *lnh, u8 *lver, u8 *sl, u8 *sc,
u16 *len, u32 *dlid, u32 *slid)
Expand Down
5 changes: 0 additions & 5 deletions include/rdma/ib_hdrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ static inline u8 ib_get_lver(struct ib_header *hdr)
IB_LVER_MASK);
}

static inline u16 ib_get_len(struct ib_header *hdr)
{
return (u16)(be16_to_cpu(hdr->lrh[2]));
}

static inline u32 ib_get_qkey(struct ib_other_headers *ohdr)
{
return be32_to_cpu(ohdr->u.ud.deth[0]);
Expand Down

0 comments on commit 17bb6b6

Please sign in to comment.