From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] reset: stm32: remove implicit sizeof(long) == 4 expectation
Date: Tue, 22 Jun 2021 20:23:32 +0200 [thread overview]
Message-ID: <20210622182332.1089832-1-ahmad@a3f.at> (raw)
There is no relation between sizeof(long) and the size of the register
of the reset controller on STM32 CPUs. They just happen to be both 32-bit
in the current configuration. U-Boot already removed the BITS_PER_LONG,
so do likewise.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
drivers/reset/reset-stm32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/reset/reset-stm32.c b/drivers/reset/reset-stm32.c
index a4498f573bb6..2ef00859c48b 100644
--- a/drivers/reset/reset-stm32.c
+++ b/drivers/reset/reset-stm32.c
@@ -81,8 +81,8 @@ static u32 stm32_reset_status(struct stm32_reset *priv, unsigned long bank)
static void stm32_reset(struct stm32_reset *priv, unsigned long id, bool assert)
{
- int bank = (id / BITS_PER_LONG) * 4;
- int offset = id % BITS_PER_LONG;
+ int bank = (id / 32) * 4;
+ int offset = id % 32;
priv->ops->reset(priv->base + bank, offset, assert);
}
--
2.32.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2021-06-22 18:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 18:23 Ahmad Fatoum [this message]
2021-06-24 8:53 ` Sascha Hauer
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=20210622182332.1089832-1-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
/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