From: Bart Van Assche <bvanassche@acm.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leonro@mellanox.com>,
Doug Ledford <dledford@redhat.com>,
linux-rdma@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Don Hiatt <don.hiatt@intel.com>,
Dennis Dalessandro <dennis.dalessandro@intel.com>
Subject: [PATCH v2 1/5] IB/hfi1: Move a function from a header file into a .c file
Date: Sun, 23 May 2021 21:12:07 -0700 [thread overview]
Message-ID: <20210524041211.9480-2-bvanassche@acm.org> (raw)
In-Reply-To: <20210524041211.9480-1-bvanassche@acm.org>
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").
Cc: Don Hiatt <don.hiatt@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/infiniband/hw/hfi1/trace.c | 5 +++++
include/rdma/ib_hdrs.h | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/trace.c b/drivers/infiniband/hw/hfi1/trace.c
index b219ea90fd6f..715c81308b85 100644
--- a/drivers/infiniband/hw/hfi1/trace.c
+++ b/drivers/infiniband/hw/hfi1/trace.c
@@ -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)
diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h
index 57c1ac881d08..7e542205861c 100644
--- a/include/rdma/ib_hdrs.h
+++ b/include/rdma/ib_hdrs.h
@@ -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]);
next prev parent reply other threads:[~2021-05-24 4:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-24 4:12 [PATCH v2 0/5] RDMA kernel patches for kernel v5.14 Bart Van Assche
2021-05-24 4:12 ` Bart Van Assche [this message]
2021-05-24 4:12 ` [PATCH v2 2/5] RDMA/srp: Add more structure size checks Bart Van Assche
2021-05-24 4:12 ` [PATCH v2 3/5] RDMA/srp: Apply the __packed attribute to members instead of structures Bart Van Assche
2021-05-24 4:12 ` [PATCH v2 4/5] RDMA/srp: Fix a recently introduced memory leak Bart Van Assche
2021-05-24 4:12 ` [PATCH v2 5/5] RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent Bart Van Assche
2021-05-28 23:23 ` [PATCH v2 0/5] RDMA kernel patches for kernel v5.14 Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210524041211.9480-2-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=don.hiatt@intel.com \
--cc=jgg@ziepe.ca \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox