Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259505
b: refs/heads/master
c: 3e4fda9
h: refs/heads/master
i:
  259503: 98ea7d7
v: v3
  • Loading branch information
matt mooney authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 8eab6dc commit 6d162d9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cbab52d18fc35e3c66f68e0382cd0815d31bb5f
refs/heads/master: 3e4fda9f956d3e8f14e8cabc6dd4f1caa95981e4
3 changes: 2 additions & 1 deletion trunk/drivers/staging/usbip/stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ struct stub_unlink {
__u32 status;
};

#define BUSID_SIZE 20
/* same as SYSFS_BUS_ID_SIZE */
#define BUSID_SIZE 32

struct bus_id_priv {
char name[BUSID_SIZE];
Expand Down
14 changes: 8 additions & 6 deletions trunk/drivers/staging/usbip/userspace/src/usbip_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int unbind_interface_busid(char *busid)
return -1;
}

ret = write(fd, busid, strnlen(busid, BUS_ID_SIZE));
ret = write(fd, busid, strnlen(busid, SYSFS_BUS_ID_SIZE));
if (ret < 0) {
dbg("write to unbind_path failed: %d", ret);
close(fd);
Expand All @@ -71,10 +71,11 @@ static int unbind_interface_busid(char *busid)

static int unbind_interface(char *busid, int configvalue, int interface)
{
char inf_busid[BUS_ID_SIZE];
char inf_busid[SYSFS_BUS_ID_SIZE];
dbg("unbinding interface");

snprintf(inf_busid, BUS_ID_SIZE, "%s:%d.%d", busid, configvalue, interface);
snprintf(inf_busid, SYSFS_BUS_ID_SIZE, "%s:%d.%d", busid, configvalue,
interface);

return unbind_interface_busid(inf_busid);
}
Expand Down Expand Up @@ -148,7 +149,7 @@ static int bind_interface_busid(char *busid, char *driver)
if (fd < 0)
return -1;

ret = write(fd, busid, strnlen(busid, BUS_ID_SIZE));
ret = write(fd, busid, strnlen(busid, SYSFS_BUS_ID_SIZE));
if (ret < 0) {
close(fd);
return -1;
Expand All @@ -161,9 +162,10 @@ static int bind_interface_busid(char *busid, char *driver)

static int bind_interface(char *busid, int configvalue, int interface, char *driver)
{
char inf_busid[BUS_ID_SIZE];
char inf_busid[SYSFS_BUS_ID_SIZE];

snprintf(inf_busid, BUS_ID_SIZE, "%s:%d.%d", busid, configvalue, interface);
snprintf(inf_busid, SYSFS_BUS_ID_SIZE, "%s:%d.%d", busid, configvalue,
interface);

return bind_interface_busid(inf_busid, driver);
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/usbip/userspace/src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int modify_match_busid(char *busid, int add)
{
int fd;
int ret;
char buff[BUS_ID_SIZE + 4];
char buff[SYSFS_BUS_ID_SIZE + 4];
char sysfs_mntpath[SYSFS_PATH_MAX];
char match_busid_path[SYSFS_PATH_MAX];

Expand All @@ -35,7 +35,7 @@ int modify_match_busid(char *busid, int add)
SYSFS_DRIVERS_NAME, USBIP_HOST_DRV_NAME);

/* BUS_IS_SIZE includes NULL termination? */
if (strnlen(busid, BUS_ID_SIZE) > BUS_ID_SIZE - 1) {
if (strnlen(busid, SYSFS_BUS_ID_SIZE) > SYSFS_BUS_ID_SIZE - 1) {
dbg("busid is too long");
return -1;
}
Expand All @@ -45,9 +45,9 @@ int modify_match_busid(char *busid, int add)
return -1;

if (add)
snprintf(buff, BUS_ID_SIZE + 4, "add %s", busid);
snprintf(buff, SYSFS_BUS_ID_SIZE + 4, "add %s", busid);
else
snprintf(buff, BUS_ID_SIZE + 4, "del %s", busid);
snprintf(buff, SYSFS_BUS_ID_SIZE + 4, "del %s", busid);

dbg("write \"%s\" to %s", buff, match_busid_path);

Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/staging/usbip/userspace/src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include <stdlib.h>

/* Be sync to kernel header */
#define BUS_ID_SIZE 20

int modify_match_busid(char *busid, int add);
int read_string(char *path, char *, size_t len);
int read_integer(char *path);
Expand Down

0 comments on commit 6d162d9

Please sign in to comment.