From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] commands: mem: Fix compiler warning
Date: Mon, 19 Nov 2018 09:19:43 +0100 [thread overview]
Message-ID: <20181119081943.11878-1-s.hauer@pengutronix.de> (raw)
resource_size_t may be 32bit on several architectures, so explicitly do
a 64bit comparison to avoid "warning: comparison of distinct pointer types
lacks a cast".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands/mem.c b/commands/mem.c
index cdd7a492d0..a9e12f3e55 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -96,8 +96,8 @@ static int mem_probe(struct device_d *dev)
dev->priv = cdev;
cdev->name = (char*)dev->resource[0].name;
- cdev->size = min(resource_size(&dev->resource[0]),
- (unsigned long long)S64_MAX);
+ cdev->size = min_t(unsigned long long, resource_size(&dev->resource[0]),
+ S64_MAX);
cdev->ops = &memops;
cdev->dev = dev;
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2018-11-19 8:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181119081943.11878-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--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