Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martyn Welch
linux
Commits
03b642a7
Commit
03b642a7
authored
12 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
atags_proc: switch to proc_create_data()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
3273097e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arch/arm/kernel/atags_proc.c
+10
-18
10 additions, 18 deletions
arch/arm/kernel/atags_proc.c
with
10 additions
and
18 deletions
arch/arm/kernel/atags_proc.c
+
10
−
18
View file @
03b642a7
...
@@ -9,24 +9,18 @@ struct buffer {
...
@@ -9,24 +9,18 @@ struct buffer {
char
data
[];
char
data
[];
};
};
static
int
static
ssize_t
atags_read
(
struct
file
*
file
,
char
__user
*
buf
,
read_buffer
(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
size_t
count
,
loff_t
*
ppos
)
int
*
eof
,
void
*
data
)
{
{
struct
buffer
*
buffer
=
(
struct
buffer
*
)
data
;
struct
buffer
*
b
=
PDE
(
file_inode
(
file
))
->
data
;
return
simple_read_from_buffer
(
buf
,
count
,
ppos
,
b
->
data
,
b
->
size
);
if
(
off
>=
buffer
->
size
)
{
*
eof
=
1
;
return
0
;
}
count
=
min
((
int
)
(
buffer
->
size
-
off
),
count
);
memcpy
(
page
,
&
buffer
->
data
[
off
],
count
);
return
count
;
}
}
static
const
struct
file_operations
atags_fops
=
{
.
read
=
atags_read
,
.
llseek
=
default_llseek
,
};
#define BOOT_PARAMS_SIZE 1536
#define BOOT_PARAMS_SIZE 1536
static
char
__initdata
atags_copy
[
BOOT_PARAMS_SIZE
];
static
char
__initdata
atags_copy
[
BOOT_PARAMS_SIZE
];
...
@@ -66,9 +60,7 @@ static int __init init_atags_procfs(void)
...
@@ -66,9 +60,7 @@ static int __init init_atags_procfs(void)
b
->
size
=
size
;
b
->
size
=
size
;
memcpy
(
b
->
data
,
atags_copy
,
size
);
memcpy
(
b
->
data
,
atags_copy
,
size
);
tags_entry
=
create_proc_read_entry
(
"atags"
,
0400
,
tags_entry
=
proc_create_data
(
"atags"
,
0400
,
NULL
,
&
atags_fops
,
b
);
NULL
,
read_buffer
,
b
);
if
(
!
tags_entry
)
if
(
!
tags_entry
)
goto
nomem
;
goto
nomem
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment