From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 2/3] mips: mt76x8: ddr_cal: Change types from u32 to int in dqs_find_min/max
Date: Fri, 6 Mar 2020 15:14:04 +0100 [thread overview]
Message-ID: <20200306141405.24539-2-sr@denx.de> (raw)
In-Reply-To: <20200306141405.24539-1-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 <sr@denx.de>
Cc: Weijie Gao <weijie.gao@mediatek.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---
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);
--
2.25.1
next prev parent reply other threads:[~2020-03-06 14:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 14:14 [PATCH 1/3] mips: mt76x8: ddr_cal: Rename dqs_test_valid() to dqs_test_error() Stefan Roese
2020-03-06 14:14 ` Stefan Roese [this message]
2020-04-15 7:21 ` [PATCH 2/3] mips: mt76x8: ddr_cal: Change types from u32 to int in dqs_find_min/max Weijie Gao
2020-03-06 14:14 ` [PATCH 3/3] mips: mt76x8: ddr_cal: Correct dqs_find_min/max implementations Stefan Roese
2020-04-15 7:20 ` Weijie Gao
2020-04-15 7:19 ` [PATCH 1/3] mips: mt76x8: ddr_cal: Rename dqs_test_valid() to dqs_test_error() Weijie Gao
2020-04-15 7:46 ` Stefan Roese
2020-04-27 13:38 ` Daniel Schwierzeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200306141405.24539-2-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox