Added a missing return value in port_init().

Cleaned up the code a bit.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@588 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-08-05 05:25:26 +00:00
parent 7f88f899f4
commit 267cf83fb3
+17 -8
View File
@@ -61,7 +61,9 @@ static int port_spinlock = 0;
#define GRAB_PORT_LOCK(s) acquire_spinlock(&(s).lock) #define GRAB_PORT_LOCK(s) acquire_spinlock(&(s).lock)
#define RELEASE_PORT_LOCK(s) release_spinlock(&(s).lock) #define RELEASE_PORT_LOCK(s) release_spinlock(&(s).lock)
int port_init(kernel_args *ka)
int
port_init(kernel_args *ka)
{ {
int i; int i;
int sz; int sz;
@@ -88,19 +90,22 @@ int port_init(kernel_args *ka)
return 0; return 0;
} }
int dump_port_list(int argc, char **argv)
int
dump_port_list(int argc, char **argv)
{ {
int i; int i;
for (i = 0; i < MAX_PORTS; i++) { for (i = 0; i < MAX_PORTS; i++) {
if(ports[i].id >= 0) { if (ports[i].id >= 0)
dprintf("%p\tid: 0x%x\t\tname: '%s'\n", &ports[i], ports[i].id, ports[i].name); dprintf("%p\tid: 0x%x\t\tname: '%s'\n", &ports[i], ports[i].id, ports[i].name);
} }
}
return 0; return 0;
} }
static void _dump_port_info(struct port_entry *port)
static void
_dump_port_info(struct port_entry *port)
{ {
int cnt; int cnt;
dprintf("PORT: %p\n", port); dprintf("PORT: %p\n", port);
@@ -115,7 +120,9 @@ static void _dump_port_info(struct port_entry *port)
dprintf("write_sem: %d\n", cnt); dprintf("write_sem: %d\n", cnt);
} }
static int dump_port_info(int argc, char **argv)
static int
dump_port_info(int argc, char **argv)
{ {
int i; int i;
@@ -146,14 +153,16 @@ static int dump_port_info(int argc, char **argv)
// walk through the ports list, trying to match name // walk through the ports list, trying to match name
for (i = 0; i < MAX_PORTS; i++) { for (i = 0; i < MAX_PORTS; i++) {
if (ports[i].name != NULL) if (ports[i].name != NULL
if(strcmp(argv[1], ports[i].name) == 0) { && strcmp(argv[1], ports[i].name) == 0) {
_dump_port_info(&ports[i]); _dump_port_info(&ports[i]);
return 0; return 0;
} }
} }
return 0;
} }
port_id port_id
create_port(int32 queue_length, const char *name) create_port(int32 queue_length, const char *name)
{ {