summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-11-19 09:18:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-19 09:18:31 +0100
commit68be59ad3b65463ae719b1ab71cb9d84b6f573a1 (patch)
tree523cb21329daab87b07183eb926314b3c082356b
parent2a32971175e0f4c29a4eec2865988d033296e6ad (diff)
downloadbarebox-68be59ad3b65463ae719b1ab71cb9d84b6f573a1.tar.gz
commands: mem: Fix compiler warning
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>
-rw-r--r--commands/mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/mem.c b/commands/mem.c
index cdd7a49..a9e12f3 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;