aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2020-03-06 15:14:04 +0100
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2020-04-27 20:30:13 +0200
commit112add362be04d085bd6b6a9d728242639404c21 (patch)
treef281a1d7a24c1499696cdcfc0bf99c4841120e81 /arch
parent896449fa29cc8b2906da540448d95eac09d99fc3 (diff)
downloadu-boot-112add362be04d085bd6b6a9d728242639404c21.zip
u-boot-112add362be04d085bd6b6a9d728242639404c21.tar.gz
u-boot-112add362be04d085bd6b6a9d728242639404c21.tar.bz2
mips: mt76x8: ddr_cal: Change types from u32 to int in dqs_find_min/max
This change is made to enable comparison of integer variables, which might be negative in the next patch. No functional change is intended in this patch. 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')
-rw-r--r--arch/mips/mach-mtmips/ddr_cal.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/mips/mach-mtmips/ddr_cal.c b/arch/mips/mach-mtmips/ddr_cal.c
index b934c4a..80a058d 100644
--- a/arch/mips/mach-mtmips/ddr_cal.c
+++ b/arch/mips/mach-mtmips/ddr_cal.c
@@ -71,10 +71,11 @@ static inline bool dqs_test_error(void __iomem *memc, u32 memsize, u32 dqsval,
return false;
}
-static inline u32 dqs_find_max(void __iomem *memc, u32 memsize, u32 initval,
- u32 maxval, u32 shift, u32 regval)
+static inline int dqs_find_max(void __iomem *memc, u32 memsize, int initval,
+ int maxval, int shift, u32 regval)
{
- u32 fieldval = initval, dqsval;
+ int fieldval = initval;
+ u32 dqsval;
do {
dqsval = regval | (fieldval << shift);
@@ -88,10 +89,11 @@ static inline u32 dqs_find_max(void __iomem *memc, u32 memsize, u32 initval,
return fieldval;
}
-static inline u32 dqs_find_min(void __iomem *memc, u32 memsize, u32 initval,
- u32 minval, u32 shift, u32 regval)
+static inline int dqs_find_min(void __iomem *memc, u32 memsize, int initval,
+ int minval, int shift, u32 regval)
{
- u32 fieldval = initval, dqsval;
+ int fieldval = initval;
+ u32 dqsval;
while (fieldval > minval) {
dqsval = regval | (fieldval << shift);