[PATCH] commands: mem: Fix compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux