From a7e89962df998a0d6c98806595641399f670174b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 21 Dec 2018 21:09:53 +0100 Subject: drvmgr: Improve LP64 compatibility --- cpukit/libdrvmgr/drvmgr_dev_by_name.c | 4 ++-- cpukit/libdrvmgr/drvmgr_for_each_dev.c | 14 +++++++------- cpukit/libdrvmgr/drvmgr_print.c | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'cpukit/libdrvmgr') diff --git a/cpukit/libdrvmgr/drvmgr_dev_by_name.c b/cpukit/libdrvmgr/drvmgr_dev_by_name.c index c62cf0c9ad..350902497c 100644 --- a/cpukit/libdrvmgr/drvmgr_dev_by_name.c +++ b/cpukit/libdrvmgr/drvmgr_dev_by_name.c @@ -12,12 +12,12 @@ #include #include "drvmgr_internal.h" -static int dev_name_compare(struct drvmgr_dev *dev, void *arg) +static intptr_t dev_name_compare(struct drvmgr_dev *dev, void *arg) { const char *name = arg; if (dev->name && (strcmp(dev->name, name) == 0)) - return (int)dev; + return (intptr_t)dev; else return 0; } diff --git a/cpukit/libdrvmgr/drvmgr_for_each_dev.c b/cpukit/libdrvmgr/drvmgr_for_each_dev.c index a1c2899d91..288360bdbf 100644 --- a/cpukit/libdrvmgr/drvmgr_for_each_dev.c +++ b/cpukit/libdrvmgr/drvmgr_for_each_dev.c @@ -13,8 +13,8 @@ #include "drvmgr_internal.h" /* Traverse device tree breadth-first. Supports up to 31 buses */ -static int drvmgr_for_each_dev_breadth( - int (*func)(struct drvmgr_dev *dev, void *arg), +static intptr_t drvmgr_for_each_dev_breadth( + intptr_t (*func)(struct drvmgr_dev *dev, void *arg), void *arg ) { @@ -43,8 +43,8 @@ static int drvmgr_for_each_dev_breadth( } /* Traverse device tree depth-first. */ -static int drvmgr_for_each_dev_depth( - int (*func)(struct drvmgr_dev *dev, void *arg), +static intptr_t drvmgr_for_each_dev_depth( + intptr_t (*func)(struct drvmgr_dev *dev, void *arg), void *arg ) { @@ -78,13 +78,13 @@ next_dev: } /* Traverse device tree depth-first or breadth-first */ -int drvmgr_for_each_dev( - int (*func)(struct drvmgr_dev *dev, void *arg), +intptr_t drvmgr_for_each_dev( + intptr_t (*func)(struct drvmgr_dev *dev, void *arg), void *arg, int options ) { - int ret; + intptr_t ret; DRVMGR_LOCK_READ(); diff --git a/cpukit/libdrvmgr/drvmgr_print.c b/cpukit/libdrvmgr/drvmgr_print.c index f53d87f18f..4b3f8c3c0f 100644 --- a/cpukit/libdrvmgr/drvmgr_print.c +++ b/cpukit/libdrvmgr/drvmgr_print.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include @@ -78,7 +79,7 @@ void drvmgr_print_devs(unsigned int options) printf("\n\n"); } -static int drvmgr_topo_func(struct drvmgr_dev *dev, void *arg) +static intptr_t drvmgr_topo_func(struct drvmgr_dev *dev, void *arg) { char prefix[32]; int depth = dev->parent->depth; @@ -341,7 +342,7 @@ void drvmgr_info_drv(struct drvmgr_drv *drv, unsigned int options) /* Print Driver */ printf(" -- DRIVER %p --\n", drv); - printf(" DRIVER ID: 0x%llx\n", drv->drv_id); + printf(" DRIVER ID: 0x%" PRIx64 "\n", drv->drv_id); printf(" NAME: %s\n", drv->name ? drv->name : "NO_NAME"); printf(" BUS TYPE: %d\n", drv->bus_type); printf(" OPERATIONS:\n"); -- cgit v1.2.3