summaryrefslogtreecommitdiff
path: root/fs/dlm/member.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-04-04 23:06:40 +0300
committerDavid Teigland <teigland@redhat.com>2022-04-06 22:02:32 +0300
commit2f9dbeda8dc04b5b754e032000adf6bab03aa9be (patch)
tree4c8b8c0550999d436bebd219b6e2afad4edc0c98 /fs/dlm/member.c
parent3428785a65dabf05bc899b6c5334984e98286184 (diff)
downloadlinux-2f9dbeda8dc04b5b754e032000adf6bab03aa9be.tar.xz
dlm: use __le types for rcom messages
This patch changes to use __le types directly in the dlm rcom 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/member.c')
-rw-r--r--fs/dlm/member.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index 4b05b0c1e76b..98084e0cfccf 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -120,18 +120,13 @@ int dlm_slots_copy_in(struct dlm_ls *ls)
ro0 = (struct rcom_slot *)(rc->rc_buf + sizeof(struct rcom_config));
- for (i = 0, ro = ro0; i < num_slots; i++, ro++) {
- ro->ro_nodeid = le32_to_cpu(ro->ro_nodeid);
- ro->ro_slot = le16_to_cpu(ro->ro_slot);
- }
-
log_slots(ls, gen, num_slots, ro0, NULL, 0);
list_for_each_entry(memb, &ls->ls_nodes, list) {
for (i = 0, ro = ro0; i < num_slots; i++, ro++) {
- if (ro->ro_nodeid != memb->nodeid)
+ if (le32_to_cpu(ro->ro_nodeid) != memb->nodeid)
continue;
- memb->slot = ro->ro_slot;
+ memb->slot = le16_to_cpu(ro->ro_slot);
memb->slot_prev = memb->slot;
break;
}