fs: dlm: move version conversion to compile time
authorAlexander Aring <aahringo@redhat.com>
Tue, 2 Nov 2021 19:17:11 +0000 (15:17 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 2 Nov 2021 19:39:20 +0000 (14:39 -0500)
This patch moves version conversion to little endian from a runtime
variable to compile time constant.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/midcomms.c

index 008078f06813d57f33289dac74ab2320ea2b8e50..76bdc3a9dc61d55f9fe078f0d7d04585efa19c50 100644 (file)
@@ -909,11 +909,11 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
                if (msglen > len)
                        break;
 
-               switch (le32_to_cpu(hd->h_version)) {
-               case DLM_VERSION_3_1:
+               switch (hd->h_version) {
+               case cpu_to_le32(DLM_VERSION_3_1):
                        dlm_midcomms_receive_buffer_3_1((union dlm_packet *)ptr, nodeid);
                        break;
-               case DLM_VERSION_3_2:
+               case cpu_to_le32(DLM_VERSION_3_2):
                        dlm_midcomms_receive_buffer_3_2((union dlm_packet *)ptr, nodeid);
                        break;
                default: