Blame SOURCES/0011-sff-8636-Convert-if-statement-to-switch-case.patch

89ea86
From 9d6316a62b6ab24dfd3cb800841df7fbbdc648ae Mon Sep 17 00:00:00 2001
89ea86
From: Ido Schimmel <idosch@nvidia.com>
89ea86
Date: Fri, 1 Oct 2021 18:06:26 +0300
89ea86
Subject: [PATCH 11/35] sff-8636: Convert if statement to switch-case
89ea86
89ea86
The indentation is wrong and the statement can be more clearly
89ea86
represented using a switch-case statement. Convert it.
89ea86
89ea86
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
89ea86
---
89ea86
 qsfp.c | 8 +++++---
89ea86
 1 file changed, 5 insertions(+), 3 deletions(-)
89ea86
89ea86
diff --git a/qsfp.c b/qsfp.c
89ea86
index 3401db84352d..d1464cb50fdc 100644
89ea86
--- a/qsfp.c
89ea86
+++ b/qsfp.c
89ea86
@@ -863,11 +863,13 @@ void sff8636_show_all(const __u8 *id, __u32 eeprom_len)
89ea86
 	}
89ea86
 
89ea86
 	sff8636_show_identifier(id);
89ea86
-	if ((id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP) ||
89ea86
-		(id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_PLUS) ||
89ea86
-		(id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP28)) {
89ea86
+	switch (id[SFF8636_ID_OFFSET]) {
89ea86
+	case SFF8024_ID_QSFP:
89ea86
+	case SFF8024_ID_QSFP_PLUS:
89ea86
+	case SFF8024_ID_QSFP28:
89ea86
 		sff8636_show_page_zero(id);
89ea86
 		sff8636_show_dom(id, id + 3 * 0x80, eeprom_len);
89ea86
+		break;
89ea86
 	}
89ea86
 }
89ea86
 
89ea86
-- 
89ea86
2.35.1
89ea86