summaryrefslogtreecommitdiffstats
path: root/usr.sbin/devinfo
diff options
context:
space:
mode:
authormikeh <mikeh@FreeBSD.org>2001-12-09 07:32:55 +0000
committermikeh <mikeh@FreeBSD.org>2001-12-09 07:32:55 +0000
commitad64dedff42e098f59b1c2a8484bb1be24d3df8a (patch)
tree2e514adb0c92be378832d95e4951af0648032536 /usr.sbin/devinfo
parent41747ff12401032e44ffdc7e1f4e5d5b052f7fde (diff)
downloadFreeBSD-src-ad64dedff42e098f59b1c2a8484bb1be24d3df8a.zip
FreeBSD-src-ad64dedff42e098f59b1c2a8484bb1be24d3df8a.tar.gz
WARNS=2 cleanup and fix potential unitialized variable bug.
PR: bin/32567 MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/devinfo')
-rw-r--r--usr.sbin/devinfo/Makefile2
-rw-r--r--usr.sbin/devinfo/devinfo.c15
2 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/devinfo/Makefile b/usr.sbin/devinfo/Makefile
index 3189188..f260e3b 100644
--- a/usr.sbin/devinfo/Makefile
+++ b/usr.sbin/devinfo/Makefile
@@ -6,4 +6,6 @@ NOMAN= #true
DPADD= ${LIBDEVINFO}
LDADD= -ldevinfo
+WARNS?= 2
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index 6f9bc5b..c74de6c 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -39,6 +39,13 @@
int rflag;
+static void print_resource(struct devinfo_res *);
+static int print_device_matching_resource(struct devinfo_res *, void *);
+static int print_device_rman_resources(struct devinfo_rman *, void *);
+static int print_device(struct devinfo_dev *, void *);
+static int print_rman_resource(struct devinfo_res *, void *);
+static int print_rman(struct devinfo_rman *, void *);
+
struct indent_arg
{
int indent;
@@ -130,7 +137,7 @@ print_device(struct devinfo_dev *dev, void *arg)
int i, indent;
if (dev->dd_name[0] != 0) {
- indent = (int)arg;
+ indent = (int)(intptr_t)arg;
for (i = 0; i < indent; i++)
printf(" ");
printf("%s\n", dev->dd_name);
@@ -143,14 +150,14 @@ print_device(struct devinfo_dev *dev, void *arg)
}
return(devinfo_foreach_device_child(dev, print_device,
- (void *)(indent + 2)));
+ (void *)((char *)arg + 2)));
}
/*
* Print information about a resource under a resource manager.
*/
int
-print_rman_resource(struct devinfo_res *res, void *arg)
+print_rman_resource(struct devinfo_res *res, void *arg __unused)
{
struct devinfo_dev *dev;
@@ -170,7 +177,7 @@ print_rman_resource(struct devinfo_res *res, void *arg)
* Print information about a resource manager.
*/
int
-print_rman(struct devinfo_rman *rman, void *arg)
+print_rman(struct devinfo_rman *rman, void *arg __unused)
{
printf("%s:\n", rman->dm_desc);
devinfo_foreach_rman_resource(rman, print_rman_resource, 0);
OpenPOWER on IntegriCloud