Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

IB/hfi1: Move a function from a header file into a .c file

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 7dafbab3753f ("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>

authored by

Bart Van Assche and committed by
Jason Gunthorpe
17bb6b6b 68e11a60

+5 -5
+5
drivers/infiniband/hw/hfi1/trace.c
··· 189 189 *qpn = ib_bth_get_qpn(ohdr); 190 190 } 191 191 192 + static u16 ib_get_len(const struct ib_header *hdr) 193 + { 194 + return be16_to_cpu(hdr->lrh[2]); 195 + } 196 + 192 197 void hfi1_trace_parse_9b_hdr(struct ib_header *hdr, bool sc5, 193 198 u8 *lnh, u8 *lver, u8 *sl, u8 *sc, 194 199 u16 *len, u32 *dlid, u32 *slid)
-5
include/rdma/ib_hdrs.h
··· 206 206 IB_LVER_MASK); 207 207 } 208 208 209 - static inline u16 ib_get_len(struct ib_header *hdr) 210 - { 211 - return (u16)(be16_to_cpu(hdr->lrh[2])); 212 - } 213 - 214 209 static inline u32 ib_get_qkey(struct ib_other_headers *ohdr) 215 210 { 216 211 return be32_to_cpu(ohdr->u.ud.deth[0]);