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@xxxxxxxxx> --- 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