[PATCH] staging: rtl8723bs: Remove constant result function CheckNegative()

From: Philipp Hortmann
Date: Tue Jul 09 2024 - 02:48:16 EST


Remove function CheckNegative() that returns always true to shorten code.

Signed-off-by: Philipp Hortmann <philipp.hortmann@xxxxxxxxxxx>
---
Tested with rtl8723bs in ODYS Trendbook Next 14
---
.../staging/rtl8723bs/hal/HalHWImg8723B_BB.c | 17 ++---------------
.../staging/rtl8723bs/hal/HalHWImg8723B_MAC.c | 12 +-----------
.../staging/rtl8723bs/hal/HalHWImg8723B_RF.c | 12 +-----------
3 files changed, 4 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
index dd0f74b0cf0d..4da2487f6750 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
@@ -70,13 +70,6 @@ static bool CheckPositive(
return false;
}

-static bool CheckNegative(
- struct dm_odm_t *pDM_Odm, const u32 Condition1, const u32 Condition2
-)
-{
- return true;
-}
-
/******************************************************************************
* AGC_TAB.TXT
******************************************************************************/
@@ -244,10 +237,7 @@ void ODM_ReadAndConfig_MP_8723B_AGC_TAB(struct dm_odm_t *pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
} else {
READ_NEXT_PAIR(v1, v2, i);
- if (!CheckNegative(pDM_Odm, v1, v2))
- bMatched = false;
- else
- bMatched = true;
+ bMatched = true;
READ_NEXT_PAIR(v1, v2, i);
}

@@ -506,10 +496,7 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG(struct dm_odm_t *pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
} else {
READ_NEXT_PAIR(v1, v2, i);
- if (!CheckNegative(pDM_Odm, v1, v2))
- bMatched = false;
- else
- bMatched = true;
+ bMatched = true;
READ_NEXT_PAIR(v1, v2, i);
}

diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
index 47e66f4ad9d1..1f0cc8d58df3 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
@@ -68,13 +68,6 @@ static bool CheckPositive(
return false;
}

-static bool CheckNegative(
- struct dm_odm_t *pDM_Odm, const u32 Condition1, const u32 Condition2
-)
-{
- return true;
-}
-
/******************************************************************************
* MAC_REG.TXT
******************************************************************************/
@@ -214,10 +207,7 @@ void ODM_ReadAndConfig_MP_8723B_MAC_REG(struct dm_odm_t *pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
} else {
READ_NEXT_PAIR(v1, v2, i);
- if (!CheckNegative(pDM_Odm, v1, v2))
- bMatched = false;
- else
- bMatched = true;
+ bMatched = true;
READ_NEXT_PAIR(v1, v2, i);
}

diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
index efc68c17b126..155ec311a52e 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
@@ -78,13 +78,6 @@ static bool CheckPositive(
return false;
}

-static bool CheckNegative(
- struct dm_odm_t *pDM_Odm, const u32 Condition1, const u32 Condition2
-)
-{
- return true;
-}
-
/******************************************************************************
* RadioA.TXT
******************************************************************************/
@@ -245,10 +238,7 @@ void ODM_ReadAndConfig_MP_8723B_RadioA(struct dm_odm_t *pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
} else {
READ_NEXT_PAIR(v1, v2, i);
- if (!CheckNegative(pDM_Odm, v1, v2))
- bMatched = false;
- else
- bMatched = true;
+ bMatched = true;
READ_NEXT_PAIR(v1, v2, i);
}

--
2.45.2