Commit 14a92fd7 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland
Browse files

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: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 00e99ccd
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -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",