Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186587
b: refs/heads/master
c: 4230020
h: refs/heads/master
i:
  186585: 5f279c8
  186583: 4651e50
v: v3
  • Loading branch information
Linus Lüssing authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent d157aa7 commit 5e8f4a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: abad5446585b0b9519fad00c05156f373ea114ad
refs/heads/master: 4230020c42457e51c98636a328c60e9f3744152c
24 changes: 12 additions & 12 deletions trunk/drivers/staging/batman-adv/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ static ssize_t proc_aggr_write(struct file *file, const char __user *buffer,
char *aggr_string;
int not_copied = 0;
unsigned long aggregation_enabled_tmp;
int retval;

aggr_string = kmalloc(count, GFP_KERNEL);

Expand All @@ -436,22 +437,21 @@ static ssize_t proc_aggr_write(struct file *file, const char __user *buffer,
not_copied = copy_from_user(aggr_string, buffer, count);
aggr_string[count - not_copied - 1] = 0;

strict_strtoul(aggr_string, 10, &aggregation_enabled_tmp);
retval = strict_strtoul(aggr_string, 10, &aggregation_enabled_tmp);

if ((aggregation_enabled_tmp != 0) && (aggregation_enabled_tmp != 1)) {
if (retval || aggregation_enabled_tmp > 1) {
printk(KERN_ERR "batman-adv:Aggregation can only be enabled (1) or disabled (0), given value: %li\n", aggregation_enabled_tmp);
goto end;
} else {
printk(KERN_INFO "batman-adv:Changing aggregation from: %s (%i) to: %s (%li)\n",
(atomic_read(&aggregation_enabled) == 1 ?
"enabled" : "disabled"),
atomic_read(&aggregation_enabled),
(aggregation_enabled_tmp == 1 ? "enabled" : "disabled"),
aggregation_enabled_tmp);
atomic_set(&aggregation_enabled,
(unsigned)aggregation_enabled_tmp);
}

printk(KERN_INFO "batman-adv:Changing aggregation from: %s (%i) to: %s (%li)\n",
(atomic_read(&aggregation_enabled) == 1 ?
"enabled" : "disabled"),
atomic_read(&aggregation_enabled),
(aggregation_enabled_tmp == 1 ? "enabled" : "disabled"),
aggregation_enabled_tmp);

atomic_set(&aggregation_enabled, (unsigned)aggregation_enabled_tmp);
end:
kfree(aggr_string);
return count;
}
Expand Down

0 comments on commit 5e8f4a8

Please sign in to comment.