1 diff -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofile_files.c linux-fixes/drivers/oprofile/oprofile_files.c
2 --- linux-cvs/drivers/oprofile/oprofile_files.c 2003-06-15 02:06:38.000000000 +0100
3 +++ linux-fixes/drivers/oprofile/oprofile_files.c 2003-08-14 19:19:05.000000000 +0100
5 unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */
8 +static ssize_t pointer_size_read(struct file * file, char * buf, size_t count, loff_t * offset)
10 + return oprofilefs_ulong_to_user((unsigned long)sizeof(void *), buf, count, offset);
14 +static struct file_operations pointer_size_fops = {
15 + .read = pointer_size_read,
19 static ssize_t cpu_type_read(struct file * file, char * buf, size_t count, loff_t * offset)
21 return oprofilefs_str_to_user(oprofile_ops->cpu_type, buf, count, offset);
24 static ssize_t enable_read(struct file * file, char * buf, size_t count, loff_t * offset)
26 - return oprofilefs_ulong_to_user(&oprofile_started, buf, count, offset);
27 + return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset);
32 oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
33 oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size);
34 oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops);
35 + oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops);
36 oprofile_create_stats_files(sb, root);
37 if (oprofile_ops->create_files)
38 oprofile_ops->create_files(sb, root);
39 diff -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofilefs.c linux-fixes/drivers/oprofile/oprofilefs.c
40 --- linux-cvs/drivers/oprofile/oprofilefs.c 2003-05-26 02:04:50.000000000 +0100
41 +++ linux-fixes/drivers/oprofile/oprofilefs.c 2003-08-14 19:21:16.000000000 +0100
46 -ssize_t oprofilefs_ulong_to_user(unsigned long * val, char * buf, size_t count, loff_t * offset)
47 +ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset)
49 char tmpbuf[TMPBUFSIZE];
54 spin_lock(&oprofilefs_lock);
55 - maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", *val);
56 + maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val);
57 spin_unlock(&oprofilefs_lock);
58 if (maxlen > TMPBUFSIZE)
62 static ssize_t ulong_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
64 - return oprofilefs_ulong_to_user(file->private_data, buf, count, offset);
65 + unsigned long * val = file->private_data;
66 + return oprofilefs_ulong_to_user(*val, buf, count, offset);
72 static ssize_t atomic_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
74 - atomic_t * aval = file->private_data;
75 - unsigned long val = atomic_read(aval);
76 - return oprofilefs_ulong_to_user(&val, buf, count, offset);
77 + atomic_t * val = file->private_data;
78 + return oprofilefs_ulong_to_user(atomic_read(val), buf, count, offset);
82 diff -X dontdiff -Naur linux-cvs/include/linux/oprofile.h linux-fixes/include/linux/oprofile.h
83 --- linux-cvs/include/linux/oprofile.h 2003-06-15 02:06:38.000000000 +0100
84 +++ linux-fixes/include/linux/oprofile.h 2003-08-14 19:19:42.000000000 +0100
86 * Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
87 * updating *offset appropriately. Returns bytes written or -EFAULT.
89 -ssize_t oprofilefs_ulong_to_user(unsigned long * val, char * buf, size_t count, loff_t * offset);
90 +ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset);
93 * Read an ASCII string for a number from a userspace buffer and fill *val on success.