summaryrefslogtreecommitdiffstats
path: root/cpukit/libdrvmgr
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-21 21:09:53 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-27 09:00:59 +0100
commita7e89962df998a0d6c98806595641399f670174b (patch)
tree7f0bc0320806cf44421d934b125006a36771d8e8 /cpukit/libdrvmgr
parentdrvmgr: Enable build for riscv (diff)
downloadrtems-a7e89962df998a0d6c98806595641399f670174b.tar.bz2
drvmgr: Improve LP64 compatibility
Diffstat (limited to 'cpukit/libdrvmgr')
-rw-r--r--cpukit/libdrvmgr/drvmgr_dev_by_name.c4
-rw-r--r--cpukit/libdrvmgr/drvmgr_for_each_dev.c14
-rw-r--r--cpukit/libdrvmgr/drvmgr_print.c5
3 files changed, 12 insertions, 11 deletions
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 <drvmgr/drvmgr.h>
#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 <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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");