From patchwork Fri Mar 6 14:14:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 243300 List-Id: U-Boot discussion From: sr at denx.de (Stefan Roese) Date: Fri, 6 Mar 2020 15:14:04 +0100 Subject: [PATCH 2/3] mips: mt76x8: ddr_cal: Change types from u32 to int in dqs_find_min/max In-Reply-To: <20200306141405.24539-1-sr@denx.de> References: <20200306141405.24539-1-sr@denx.de> Message-ID: <20200306141405.24539-2-sr@denx.de> 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 Cc: Weijie Gao Cc: Daniel Schwierzeck --- arch/mips/mach-mtmips/ddr_cal.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/mips/mach-mtmips/ddr_cal.c b/arch/mips/mach-mtmips/ddr_cal.c index b934c4a854..80a058d693 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);