1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

WARNS=2 cleanup and fix potential unitialized variable bug.

PR:		bin/32567
MFC after:	2 weeks
This commit is contained in:
Mike Heffner 2001-12-09 07:32:55 +00:00
parent 87e5cd7c1a
commit 84e0df3fcf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87553
2 changed files with 13 additions and 4 deletions

View File

@ -6,4 +6,6 @@ NOMAN= #true
DPADD= ${LIBDEVINFO}
LDADD= -ldevinfo
WARNS?= 2
.include <bsd.prog.mk>

View File

@ -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);