Merge branches 'softirq-for-linus', 'x86-debug-for-linus', 'x86-numa-for-linus',...
[pandora-kernel.git] / arch / x86 / kernel / tlb_uv.c
index 312ef02..20ea20a 100644 (file)
@@ -1001,10 +1001,10 @@ static int uv_ptc_seq_show(struct seq_file *file, void *data)
 static ssize_t tunables_read(struct file *file, char __user *userbuf,
                                                size_t count, loff_t *ppos)
 {
-       char buf[300];
+       char *buf;
        int ret;
 
-       ret = snprintf(buf, 300, "%s %s %s\n%d %d %d %d %d %d %d %d %d\n",
+       buf = kasprintf(GFP_KERNEL, "%s %s %s\n%d %d %d %d %d %d %d %d %d\n",
                "max_bau_concurrent plugged_delay plugsb4reset",
                "timeoutsb4reset ipi_reset_limit complete_threshold",
                "congested_response_us congested_reps congested_period",
@@ -1012,7 +1012,12 @@ static ssize_t tunables_read(struct file *file, char __user *userbuf,
                timeoutsb4reset, ipi_reset_limit, complete_threshold,
                congested_response_us, congested_reps, congested_period);
 
-       return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
+       if (!buf)
+               return -ENOMEM;
+
+       ret = simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
+       kfree(buf);
+       return ret;
 }
 
 /*
@@ -1285,6 +1290,7 @@ static const struct file_operations tunables_fops = {
        .open           = tunables_open,
        .read           = tunables_read,
        .write          = tunables_write,
+       .llseek         = default_llseek,
 };
 
 static int __init uv_ptc_init(void)