Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89685
b: refs/heads/master
c: f3df41c
h: refs/heads/master
i:
  89683: 0efc485
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Apr 7, 2008
1 parent df2443d commit e5a8980
Show file tree
Hide file tree
Showing 2 changed files with 4 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: 1c353f7d616a4ef04b5e73fe7a2184baa039f06f
refs/heads/master: f3df41cff40992499d3c693251622299e4ce18c3
17 changes: 3 additions & 14 deletions trunk/drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2681,21 +2681,10 @@ static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf)
static ssize_t sdebug_add_host_store(struct device_driver * ddp,
const char * buf, size_t count)
{
int delta_hosts;
char work[20];
int delta_hosts;

if (1 != sscanf(buf, "%10s", work))
if (sscanf(buf, "%d", &delta_hosts) != 1)
return -EINVAL;
{ /* temporary hack around sscanf() problem with -ve nums */
int neg = 0;

if ('-' == *work)
neg = 1;
if (1 != sscanf(work + neg, "%d", &delta_hosts))
return -EINVAL;
if (neg)
delta_hosts = -delta_hosts;
}
if (delta_hosts > 0) {
do {
sdebug_add_adapter();
Expand All @@ -2707,7 +2696,7 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp,
}
return count;
}
DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show,
DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show,
sdebug_add_host_store);

static ssize_t sdebug_vpd_use_hostno_show(struct device_driver * ddp,
Expand Down

0 comments on commit e5a8980

Please sign in to comment.