Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
072ab23d
Commit
072ab23d
authored
May 28, 2004
by
Alexander Viro
Committed by
Linus Torvalds
May 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: oprofile __user annotation
parent
da9a37d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
drivers/oprofile/event_buffer.c
drivers/oprofile/event_buffer.c
+1
-1
drivers/oprofile/oprofile_files.c
drivers/oprofile/oprofile_files.c
+6
-6
drivers/oprofile/oprofilefs.c
drivers/oprofile/oprofilefs.c
+6
-6
include/linux/oprofile.h
include/linux/oprofile.h
+3
-3
No files found.
drivers/oprofile/event_buffer.c
View file @
072ab23d
...
@@ -142,7 +142,7 @@ int event_buffer_release(struct inode * inode, struct file * file)
...
@@ -142,7 +142,7 @@ int event_buffer_release(struct inode * inode, struct file * file)
}
}
ssize_t
event_buffer_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
ssize_t
event_buffer_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
int
retval
=
-
EINVAL
;
int
retval
=
-
EINVAL
;
size_t
const
max
=
buffer_size
*
sizeof
(
unsigned
long
);
size_t
const
max
=
buffer_size
*
sizeof
(
unsigned
long
);
...
...
drivers/oprofile/oprofile_files.c
View file @
072ab23d
...
@@ -19,9 +19,9 @@ unsigned long fs_cpu_buffer_size = 8192;
...
@@ -19,9 +19,9 @@ unsigned long fs_cpu_buffer_size = 8192;
unsigned
long
fs_buffer_watershed
=
32768
;
/* FIXME: tune */
unsigned
long
fs_buffer_watershed
=
32768
;
/* FIXME: tune */
static
ssize_t
pointer_size_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
pointer_size_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
return
oprofilefs_ulong_to_user
(
(
unsigned
long
)
sizeof
(
void
*
),
buf
,
count
,
offset
);
return
oprofilefs_ulong_to_user
(
sizeof
(
void
*
),
buf
,
count
,
offset
);
}
}
...
@@ -30,7 +30,7 @@ static struct file_operations pointer_size_fops = {
...
@@ -30,7 +30,7 @@ static struct file_operations pointer_size_fops = {
};
};
static
ssize_t
cpu_type_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
cpu_type_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
return
oprofilefs_str_to_user
(
oprofile_ops
->
cpu_type
,
buf
,
count
,
offset
);
return
oprofilefs_str_to_user
(
oprofile_ops
->
cpu_type
,
buf
,
count
,
offset
);
}
}
...
@@ -41,13 +41,13 @@ static struct file_operations cpu_type_fops = {
...
@@ -41,13 +41,13 @@ static struct file_operations cpu_type_fops = {
};
};
static
ssize_t
enable_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
enable_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
return
oprofilefs_ulong_to_user
(
oprofile_started
,
buf
,
count
,
offset
);
return
oprofilefs_ulong_to_user
(
oprofile_started
,
buf
,
count
,
offset
);
}
}
static
ssize_t
enable_write
(
struct
file
*
file
,
char
const
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
enable_write
(
struct
file
*
file
,
char
const
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
unsigned
long
val
;
unsigned
long
val
;
int
retval
;
int
retval
;
...
@@ -76,7 +76,7 @@ static struct file_operations enable_fops = {
...
@@ -76,7 +76,7 @@ static struct file_operations enable_fops = {
};
};
static
ssize_t
dump_write
(
struct
file
*
file
,
char
const
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
dump_write
(
struct
file
*
file
,
char
const
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
wake_up_buffer_waiter
();
wake_up_buffer_waiter
();
return
count
;
return
count
;
...
...
drivers/oprofile/oprofilefs.c
View file @
072ab23d
...
@@ -45,7 +45,7 @@ static struct super_operations s_ops = {
...
@@ -45,7 +45,7 @@ static struct super_operations s_ops = {
};
};
ssize_t
oprofilefs_str_to_user
(
char
const
*
str
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
ssize_t
oprofilefs_str_to_user
(
char
const
*
str
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
size_t
len
=
strlen
(
str
);
size_t
len
=
strlen
(
str
);
...
@@ -69,7 +69,7 @@ ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_
...
@@ -69,7 +69,7 @@ ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_
#define TMPBUFSIZE 50
#define TMPBUFSIZE 50
ssize_t
oprofilefs_ulong_to_user
(
unsigned
long
val
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
ssize_t
oprofilefs_ulong_to_user
(
unsigned
long
val
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
char
tmpbuf
[
TMPBUFSIZE
];
char
tmpbuf
[
TMPBUFSIZE
];
size_t
maxlen
;
size_t
maxlen
;
...
@@ -98,7 +98,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, lo
...
@@ -98,7 +98,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, lo
}
}
int
oprofilefs_ulong_from_user
(
unsigned
long
*
val
,
char
const
*
buf
,
size_t
count
)
int
oprofilefs_ulong_from_user
(
unsigned
long
*
val
,
char
const
__user
*
buf
,
size_t
count
)
{
{
char
tmpbuf
[
TMPBUFSIZE
];
char
tmpbuf
[
TMPBUFSIZE
];
...
@@ -120,14 +120,14 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t cou
...
@@ -120,14 +120,14 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t cou
}
}
static
ssize_t
ulong_read_file
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
ulong_read_file
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
unsigned
long
*
val
=
file
->
private_data
;
unsigned
long
*
val
=
file
->
private_data
;
return
oprofilefs_ulong_to_user
(
*
val
,
buf
,
count
,
offset
);
return
oprofilefs_ulong_to_user
(
*
val
,
buf
,
count
,
offset
);
}
}
static
ssize_t
ulong_write_file
(
struct
file
*
file
,
char
const
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
ulong_write_file
(
struct
file
*
file
,
char
const
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
unsigned
long
*
value
=
file
->
private_data
;
unsigned
long
*
value
=
file
->
private_data
;
int
retval
;
int
retval
;
...
@@ -211,7 +211,7 @@ int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
...
@@ -211,7 +211,7 @@ int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
}
}
static
ssize_t
atomic_read_file
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
)
static
ssize_t
atomic_read_file
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
{
atomic_t
*
val
=
file
->
private_data
;
atomic_t
*
val
=
file
->
private_data
;
return
oprofilefs_ulong_to_user
(
atomic_read
(
val
),
buf
,
count
,
offset
);
return
oprofilefs_ulong_to_user
(
atomic_read
(
val
),
buf
,
count
,
offset
);
...
...
include/linux/oprofile.h
View file @
072ab23d
...
@@ -86,19 +86,19 @@ struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
...
@@ -86,19 +86,19 @@ struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
* Write the given asciz string to the given user buffer @buf, updating *offset
* Write the given asciz string to the given user buffer @buf, updating *offset
* appropriately. Returns bytes written or -EFAULT.
* appropriately. Returns bytes written or -EFAULT.
*/
*/
ssize_t
oprofilefs_str_to_user
(
char
const
*
str
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
);
ssize_t
oprofilefs_str_to_user
(
char
const
*
str
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
);
/**
/**
* Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
* Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
* updating *offset appropriately. Returns bytes written or -EFAULT.
* updating *offset appropriately. Returns bytes written or -EFAULT.
*/
*/
ssize_t
oprofilefs_ulong_to_user
(
unsigned
long
val
,
char
*
buf
,
size_t
count
,
loff_t
*
offset
);
ssize_t
oprofilefs_ulong_to_user
(
unsigned
long
val
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
);
/**
/**
* Read an ASCII string for a number from a userspace buffer and fill *val on success.
* Read an ASCII string for a number from a userspace buffer and fill *val on success.
* Returns 0 on success, < 0 on error.
* Returns 0 on success, < 0 on error.
*/
*/
int
oprofilefs_ulong_from_user
(
unsigned
long
*
val
,
char
const
*
buf
,
size_t
count
);
int
oprofilefs_ulong_from_user
(
unsigned
long
*
val
,
char
const
__user
*
buf
,
size_t
count
);
/** lock for read/write safety */
/** lock for read/write safety */
extern
spinlock_t
oprofilefs_lock
;
extern
spinlock_t
oprofilefs_lock
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment