aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/util.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-04-04 16:06:39 -0400
committerDavid Teigland <teigland@redhat.com>2022-04-06 14:02:28 -0500
commit3428785a65dabf05bc899b6c5334984e98286184 (patch)
treedf408c803eb6b1b890f1493042e7e554a7a619ad /fs/dlm/util.c
parentdlm: use __le types for options header (diff)
downloadlinux-dev-3428785a65dabf05bc899b6c5334984e98286184.tar.xz
linux-dev-3428785a65dabf05bc899b6c5334984e98286184.zip
dlm: use __le types for dlm header
This patch changes to use __le types directly in the dlm header structure which is casted at the right dlm message buffer positions. The main goal what is reached here is to remove sparse warnings regarding to host to little byte order conversion or vice versa. Leaving those sparse issues ignored and always do it in out/in functionality tends to leave it unknown in which byte order the variable is being handled. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/util.c')
-rw-r--r--fs/dlm/util.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/fs/dlm/util.c b/fs/dlm/util.c
index 58acbcc2081a..66b9a123768d 100644
--- a/fs/dlm/util.c
+++ b/fs/dlm/util.c
@@ -20,24 +20,6 @@
#define DLM_ERRNO_ETIMEDOUT 110
#define DLM_ERRNO_EINPROGRESS 115
-void header_out(struct dlm_header *hd)
-{
- hd->h_version = cpu_to_le32(hd->h_version);
- /* does it for others u32 in union as well */
- hd->u.h_lockspace = cpu_to_le32(hd->u.h_lockspace);
- hd->h_nodeid = cpu_to_le32(hd->h_nodeid);
- hd->h_length = cpu_to_le16(hd->h_length);
-}
-
-void header_in(struct dlm_header *hd)
-{
- hd->h_version = le32_to_cpu(hd->h_version);
- /* does it for others u32 in union as well */
- hd->u.h_lockspace = le32_to_cpu(hd->u.h_lockspace);
- hd->h_nodeid = le32_to_cpu(hd->h_nodeid);
- hd->h_length = le16_to_cpu(hd->h_length);
-}
-
/* higher errno values are inconsistent across architectures, so select
one set of values for on the wire */
@@ -85,8 +67,6 @@ static int from_dlm_errno(int err)
void dlm_message_out(struct dlm_message *ms)
{
- header_out(&ms->m_header);
-
ms->m_type = cpu_to_le32(ms->m_type);
ms->m_nodeid = cpu_to_le32(ms->m_nodeid);
ms->m_pid = cpu_to_le32(ms->m_pid);
@@ -109,8 +89,6 @@ void dlm_message_out(struct dlm_message *ms)
void dlm_message_in(struct dlm_message *ms)
{
- header_in(&ms->m_header);
-
ms->m_type = le32_to_cpu(ms->m_type);
ms->m_nodeid = le32_to_cpu(ms->m_nodeid);
ms->m_pid = le32_to_cpu(ms->m_pid);
@@ -133,8 +111,6 @@ void dlm_message_in(struct dlm_message *ms)
void dlm_rcom_out(struct dlm_rcom *rc)
{
- header_out(&rc->rc_header);
-
rc->rc_type = cpu_to_le32(rc->rc_type);
rc->rc_result = cpu_to_le32(rc->rc_result);
rc->rc_id = cpu_to_le64(rc->rc_id);
@@ -144,8 +120,6 @@ void dlm_rcom_out(struct dlm_rcom *rc)
void dlm_rcom_in(struct dlm_rcom *rc)
{
- header_in(&rc->rc_header);
-
rc->rc_type = le32_to_cpu(rc->rc_type);
rc->rc_result = le32_to_cpu(rc->rc_result);
rc->rc_id = le64_to_cpu(rc->rc_id);