diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-04-04 16:06:42 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-04-06 14:02:40 -0500 |
commit | 14a92fd7038279bf652b6daa5ab6e4241b66fad6 (patch) | |
tree | c06af772e23d9630fd091fd07dc9c7532cfcb749 /fs/dlm/midcomms.c | |
parent | 00e99ccde75722599faf089416341bfed7e4edb5 (diff) | |
download | linux-rpi-14a92fd7038279bf652b6daa5ab6e4241b66fad6.tar.gz linux-rpi-14a92fd7038279bf652b6daa5ab6e4241b66fad6.tar.bz2 linux-rpi-14a92fd7038279bf652b6daa5ab6e4241b66fad6.zip |
dlm: move conversion to compile time
This patch is a cleanup to move the byte order conversion to compile
time. In a simple comparison like this it's possible to move it to
static values so the compiler will always convert those values at
compile time.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/midcomms.c')
-rw-r--r-- | fs/dlm/midcomms.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index bd4bed09ab2b..649efe120eee 100644 --- a/fs/dlm/midcomms.c +++ b/fs/dlm/midcomms.c @@ -571,14 +571,14 @@ dlm_midcomms_recv_node_lookup(int nodeid, const union dlm_packet *p, return NULL; } - switch (le32_to_cpu(p->rcom.rc_type)) { - case DLM_RCOM_NAMES: + switch (p->rcom.rc_type) { + case cpu_to_le32(DLM_RCOM_NAMES): fallthrough; - case DLM_RCOM_NAMES_REPLY: + case cpu_to_le32(DLM_RCOM_NAMES_REPLY): fallthrough; - case DLM_RCOM_STATUS: + case cpu_to_le32(DLM_RCOM_STATUS): fallthrough; - case DLM_RCOM_STATUS_REPLY: + case cpu_to_le32(DLM_RCOM_STATUS_REPLY): node = nodeid2node(nodeid, 0); if (node) { spin_lock(&node->state_lock); @@ -738,14 +738,14 @@ static void dlm_midcomms_receive_buffer_3_2(union dlm_packet *p, int nodeid) * * length already checked. */ - switch (le32_to_cpu(p->rcom.rc_type)) { - case DLM_RCOM_NAMES: + switch (p->rcom.rc_type) { + case cpu_to_le32(DLM_RCOM_NAMES): fallthrough; - case DLM_RCOM_NAMES_REPLY: + case cpu_to_le32(DLM_RCOM_NAMES_REPLY): fallthrough; - case DLM_RCOM_STATUS: + case cpu_to_le32(DLM_RCOM_STATUS): fallthrough; - case DLM_RCOM_STATUS_REPLY: + case cpu_to_le32(DLM_RCOM_STATUS_REPLY): break; default: log_print("unsupported rcom type received: %u, will skip this message from node %d", |