summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2020-03-06 17:14:03 +0300
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2020-04-27 21:30:13 +0300
commit896449fa29cc8b2906da540448d95eac09d99fc3 (patch)
tree56bce3ad6a836d237c55f7f3e59c0fc107a3f198 /arch/mips
parente9dbd1ac8239317809dba140125c1f35f03524de (diff)
downloadu-boot-896449fa29cc8b2906da540448d95eac09d99fc3.tar.xz
mips: mt76x8: ddr_cal: Rename dqs_test_valid() to dqs_test_error()
This function returns "-1" (true) upon error. So the function name does not match its implementation which is confusing. This patch renames the function to dqs_test_error() which makes the code easier to read. Also change the return type to bool and return "true" or "false". Signed-off-by: Stefan Roese <sr@denx.de> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/mach-mtmips/ddr_cal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/mips/mach-mtmips/ddr_cal.c b/arch/mips/mach-mtmips/ddr_cal.c
index 0ea7c7d5e1..b934c4a854 100644
--- a/arch/mips/mach-mtmips/ddr_cal.c
+++ b/arch/mips/mach-mtmips/ddr_cal.c
@@ -32,8 +32,8 @@ static inline void pref_op(int op, const volatile void *addr)
__asm__ __volatile__("pref %0, 0(%1)" : : "i" (op), "r" (addr));
}
-static inline int dqs_test_valid(void __iomem *memc, u32 memsize, u32 dqsval,
- u32 bias)
+static inline bool dqs_test_error(void __iomem *memc, u32 memsize, u32 dqsval,
+ u32 bias)
{
u32 *nca, *ca;
u32 off;
@@ -64,11 +64,11 @@ static inline int dqs_test_valid(void __iomem *memc, u32 memsize, u32 dqsval,
for (i = 0; i < TEST_PAT_SIZE / sizeof(u32); i++) {
if (ca[i] != (u32)nca + i + bias)
- return -1;
+ return true;
}
}
- return 0;
+ return false;
}
static inline u32 dqs_find_max(void __iomem *memc, u32 memsize, u32 initval,
@@ -79,7 +79,7 @@ static inline u32 dqs_find_max(void __iomem *memc, u32 memsize, u32 initval,
do {
dqsval = regval | (fieldval << shift);
- if (dqs_test_valid(memc, memsize, dqsval, 3))
+ if (dqs_test_error(memc, memsize, dqsval, 3))
break;
fieldval++;
@@ -96,7 +96,7 @@ static inline u32 dqs_find_min(void __iomem *memc, u32 memsize, u32 initval,
while (fieldval > minval) {
dqsval = regval | (fieldval << shift);
- if (dqs_test_valid(memc, memsize, dqsval, 1)) {
+ if (dqs_test_error(memc, memsize, dqsval, 1)) {
fieldval++;
break;
}