aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/stub_main.c
diff options
context:
space:
mode:
authormerge <null@invalid>2009-01-22 13:55:32 +0000
committerAndy Green <agreen@octopus.localdomain>2009-01-22 13:55:32 +0000
commitaa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch)
treefbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/staging/usbip/stub_main.c
parentf2d78193eae5dccd3d588d2c8ea0866efc368332 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/staging/usbip/stub_main.c')
-rw-r--r--drivers/staging/usbip/stub_main.c21
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)) {