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:
+17
-8
@@ -61,7 +61,9 @@ static int port_spinlock = 0;
|
||||
#define GRAB_PORT_LOCK(s) acquire_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 sz;
|
||||
@@ -88,19 +90,22 @@ int port_init(kernel_args *ka)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dump_port_list(int argc, char **argv)
|
||||
|
||||
int
|
||||
dump_port_list(int argc, char **argv)
|
||||
{
|
||||
int 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);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _dump_port_info(struct port_entry *port)
|
||||
|
||||
static void
|
||||
_dump_port_info(struct port_entry *port)
|
||||
{
|
||||
int cnt;
|
||||
dprintf("PORT: %p\n", port);
|
||||
@@ -115,7 +120,9 @@ static void _dump_port_info(struct port_entry *port)
|
||||
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;
|
||||
|
||||
@@ -146,14 +153,16 @@ static int dump_port_info(int argc, char **argv)
|
||||
|
||||
// walk through the ports list, trying to match name
|
||||
for (i = 0; i < MAX_PORTS; i++) {
|
||||
if (ports[i].name != NULL)
|
||||
if(strcmp(argv[1], ports[i].name) == 0) {
|
||||
if (ports[i].name != NULL
|
||||
&& strcmp(argv[1], ports[i].name) == 0) {
|
||||
_dump_port_info(&ports[i]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
port_id
|
||||
create_port(int32 queue_length, const char *name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user