[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220128115445.6606-7-straube.linux@gmail.com>
Date: Fri, 28 Jan 2022 12:54:45 +0100
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH 6/6] staging: r8188eu: remove IS_*_CUT macros
Remove the IS_*_CUT macros from HalVerDef.h. They are not needed, we
can use a switch on chip_vers.CUTVersion directly in dump_chip_info()
Signed-off-by: Michael Straube <straube.linux@...il.com>
---
drivers/staging/r8188eu/hal/hal_com.c | 24 ++++++++++++++-------
drivers/staging/r8188eu/include/HalVerDef.h | 18 ----------------
2 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/hal_com.c b/drivers/staging/r8188eu/hal/hal_com.c
index ba5d027d765f..7f28fd08f0aa 100644
--- a/drivers/staging/r8188eu/hal/hal_com.c
+++ b/drivers/staging/r8188eu/hal/hal_com.c
@@ -20,19 +20,27 @@ void dump_chip_info(struct HAL_VERSION chip_vers)
"Normal_Chip" : "Test_Chip");
cnt += sprintf((buf + cnt), "%s_", IS_CHIP_VENDOR_TSMC(chip_vers) ?
"TSMC" : "UMC");
- if (IS_A_CUT(chip_vers))
+
+ switch (chip_vers.CUTVersion) {
+ case A_CUT_VERSION:
cnt += sprintf((buf + cnt), "A_CUT_");
- else if (IS_B_CUT(chip_vers))
+ break;
+ case B_CUT_VERSION:
cnt += sprintf((buf + cnt), "B_CUT_");
- else if (IS_C_CUT(chip_vers))
+ break;
+ case C_CUT_VERSION:
cnt += sprintf((buf + cnt), "C_CUT_");
- else if (IS_D_CUT(chip_vers))
+ break;
+ case D_CUT_VERSION:
cnt += sprintf((buf + cnt), "D_CUT_");
- else if (IS_E_CUT(chip_vers))
+ break;
+ case E_CUT_VERSION:
cnt += sprintf((buf + cnt), "E_CUT_");
- else
- cnt += sprintf((buf + cnt), "UNKNOWN_CUT(%d)_",
- chip_vers.CUTVersion);
+ break;
+ default:
+ cnt += sprintf((buf + cnt), "UNKNOWN_CUT(%d)_", chip_vers.CUTVersion);
+ break;
+ }
cnt += sprintf((buf + cnt), "1T1R_");
diff --git a/drivers/staging/r8188eu/include/HalVerDef.h b/drivers/staging/r8188eu/include/HalVerDef.h
index f4816ac765e5..2bc18eabb55d 100644
--- a/drivers/staging/r8188eu/include/HalVerDef.h
+++ b/drivers/staging/r8188eu/include/HalVerDef.h
@@ -14,8 +14,6 @@ enum HAL_CUT_VERSION {
C_CUT_VERSION = 2,
D_CUT_VERSION = 3,
E_CUT_VERSION = 4,
- F_CUT_VERSION = 5,
- G_CUT_VERSION = 6,
};
enum HAL_VENDOR {
@@ -33,27 +31,11 @@ struct HAL_VERSION {
/* Get element */
#define GET_CVID_CHIP_TYPE(version) (((version).ChipType))
#define GET_CVID_MANUFACTUER(version) (((version).VendorType))
-#define GET_CVID_CUT_VERSION(version) (((version).CUTVersion))
-
-/* Common Macro. -- */
-/* HAL_VERSION VersionID */
/* HAL_CHIP_TYPE_E */
#define IS_NORMAL_CHIP(version) \
((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? true : false)
-/* HAL_CUT_VERSION_E */
-#define IS_A_CUT(version) \
- ((GET_CVID_CUT_VERSION(version) == A_CUT_VERSION) ? true : false)
-#define IS_B_CUT(version) \
- ((GET_CVID_CUT_VERSION(version) == B_CUT_VERSION) ? true : false)
-#define IS_C_CUT(version) \
- ((GET_CVID_CUT_VERSION(version) == C_CUT_VERSION) ? true : false)
-#define IS_D_CUT(version) \
- ((GET_CVID_CUT_VERSION(version) == D_CUT_VERSION) ? true : false)
-#define IS_E_CUT(version) \
- ((GET_CVID_CUT_VERSION(version) == E_CUT_VERSION) ? true : false)
-
/* HAL_VENDOR_E */
#define IS_CHIP_VENDOR_TSMC(version) \
((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC) ? true : false)
--
2.34.1
Powered by blists - more mailing lists