Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148902
b: refs/heads/master
c: 9319cec
h: refs/heads/master
v: v3
  • Loading branch information
Hidetoshi Seto authored and H. Peter Anvin committed May 28, 2009
1 parent d217ff0 commit 5a56a56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 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: 8780e8e0f6b34862cdf2c62d4d2674d6bc3207db
refs/heads/master: 9319cec8c185e84fc5281afb6ac5d4c47a234841
9 changes: 4 additions & 5 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,18 +1059,17 @@ static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr,
}

static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
const char *buf, size_t siz)
const char *buf, size_t size)
{
char *end;
u64 new = simple_strtoull(buf, &end, 0);
u64 new;

if (end == buf)
if (strict_strtoull(buf, 0, &new) < 0)
return -EINVAL;

bank[attr - bank_attrs] = new;
mce_restart();

return end-buf;
return size;
}

static ssize_t
Expand Down
16 changes: 6 additions & 10 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,12 @@ SHOW_FIELDS(interrupt_enable)
SHOW_FIELDS(threshold_limit)

static ssize_t
store_interrupt_enable(struct threshold_block *b, const char *buf, size_t count)
store_interrupt_enable(struct threshold_block *b, const char *buf, size_t size)
{
struct thresh_restart tr;
unsigned long new;
char *end;

new = simple_strtoul(buf, &end, 0);
if (end == buf)
if (strict_strtoul(buf, 0, &new) < 0)
return -EINVAL;

b->interrupt_enable = !!new;
Expand All @@ -287,18 +285,16 @@ store_interrupt_enable(struct threshold_block *b, const char *buf, size_t count)

smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);

return end - buf;
return size;
}

static ssize_t
store_threshold_limit(struct threshold_block *b, const char *buf, size_t count)
store_threshold_limit(struct threshold_block *b, const char *buf, size_t size)
{
struct thresh_restart tr;
unsigned long new;
char *end;

new = simple_strtoul(buf, &end, 0);
if (end == buf)
if (strict_strtoul(buf, 0, &new) < 0)
return -EINVAL;

if (new > THRESHOLD_MAX)
Expand All @@ -313,7 +309,7 @@ store_threshold_limit(struct threshold_block *b, const char *buf, size_t count)

smp_call_function_single(b->cpu, threshold_restart_bank, &tr, 1);

return end - buf;
return size;
}

struct threshold_block_cross_cpu {
Expand Down

0 comments on commit 5a56a56

Please sign in to comment.