diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-30 01:59:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:52:05 -0800 |
commit | e913397202b7551299da20fc8cf7b90c46f61ba3 (patch) | |
tree | 367967524f55040a74d36495c0adbfd6a30a087e /drivers/staging/usbip/stub_main.c | |
parent | 9f37952aa0088242db7c19a8e31a6d284e4079e9 (diff) |
staging: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/usbip/stub_main.c')
-rw-r--r-- | drivers/staging/usbip/stub_main.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c index c665d7f1ca9..05e4c606439 100644 --- a/drivers/staging/usbip/stub_main.c +++ b/drivers/staging/usbip/stub_main.c @@ -40,11 +40,12 @@ struct kmem_cache *stub_priv_cache; * remote host. */ #define MAX_BUSID 16 -static char busid_table[MAX_BUSID][BUS_ID_SIZE]; +#define BUSID_SIZE 20 +static char busid_table[MAX_BUSID][BUSID_SIZE]; static spinlock_t busid_table_lock; -int match_busid(char *busid) +int match_busid(const char *busid) { int i; @@ -52,7 +53,7 @@ int match_busid(char *busid) for (i = 0; i < MAX_BUSID; i++) if (busid_table[i][0]) - if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { + if (!strncmp(busid_table[i], busid, BUSID_SIZE)) { /* already registerd */ spin_unlock(&busid_table_lock); return 0; @@ -92,7 +93,7 @@ static int add_match_busid(char *busid) for (i = 0; i < MAX_BUSID; i++) if (!busid_table[i][0]) { - strncpy(busid_table[i], busid, BUS_ID_SIZE); + strncpy(busid_table[i], busid, BUSID_SIZE); spin_unlock(&busid_table_lock); return 0; } @@ -109,9 +110,9 @@ static int del_match_busid(char *busid) spin_lock(&busid_table_lock); for (i = 0; i < MAX_BUSID; i++) - if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { + if (!strncmp(busid_table[i], busid, BUSID_SIZE)) { /* found */ - memset(busid_table[i], 0, BUS_ID_SIZE); + memset(busid_table[i], 0, BUSID_SIZE); spin_unlock(&busid_table_lock); return 0; } @@ -125,19 +126,19 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf, size_t count) { int len; - char busid[BUS_ID_SIZE]; + char busid[BUSID_SIZE]; if (count < 5) return -EINVAL; /* strnlen() does not include \0 */ - len = strnlen(buf + 4, BUS_ID_SIZE); + len = strnlen(buf + 4, BUSID_SIZE); /* busid needs to include \0 termination */ - if (!(len < BUS_ID_SIZE)) + if (!(len < BUSID_SIZE)) return -EINVAL; - strncpy(busid, buf + 4, BUS_ID_SIZE); + strncpy(busid, buf + 4, BUSID_SIZE); if (!strncmp(buf, "add ", 4)) { |