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
82f3952c
Commit
82f3952c
authored
May 21, 2010
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handling of offsets in cris eeprom.c, get rid of fake on-stack files
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4f0447b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v10/drivers/eeprom.c
+7
-14
No files found.
arch/cris/arch-v10/drivers/eeprom.c
View file @
82f3952c
...
...
@@ -437,10 +437,7 @@ static loff_t eeprom_lseek(struct file * file, loff_t offset, int orig)
static
int
eeprom_read_buf
(
loff_t
addr
,
char
*
buf
,
int
count
)
{
struct
file
f
;
f
.
f_pos
=
addr
;
return
eeprom_read
(
&
f
,
buf
,
count
,
&
addr
);
return
eeprom_read
(
NULL
,
buf
,
count
,
&
addr
);
}
...
...
@@ -450,7 +447,7 @@ static int eeprom_read_buf(loff_t addr, char * buf, int count)
static
ssize_t
eeprom_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
off
)
{
int
read
=
0
;
unsigned
long
p
=
file
->
f_pos
;
unsigned
long
p
=
*
off
;
unsigned
char
page
;
...
...
@@ -495,7 +492,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
if
(
read
>
0
)
{
file
->
f_pos
+=
read
;
*
off
+=
read
;
}
mutex_unlock
(
&
eeprom
.
lock
);
...
...
@@ -506,11 +503,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
static
int
eeprom_write_buf
(
loff_t
addr
,
const
char
*
buf
,
int
count
)
{
struct
file
f
;
f
.
f_pos
=
addr
;
return
eeprom_write
(
&
f
,
buf
,
count
,
&
addr
);
return
eeprom_write
(
NULL
,
buf
,
count
,
&
addr
);
}
...
...
@@ -534,7 +527,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
{
restart
=
0
;
written
=
0
;
p
=
file
->
f_pos
;
p
=
*
off
;
while
(
(
written
<
count
)
&&
(
p
<
eeprom
.
size
))
...
...
@@ -660,10 +653,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
}
/* for */
mutex_unlock
(
&
eeprom
.
lock
);
if
(
written
==
0
&&
file
->
f_pos
>=
eeprom
.
size
){
if
(
written
==
0
&&
p
>=
eeprom
.
size
){
return
-
ENOSPC
;
}
file
->
f_pos
+=
written
;
*
off
=
p
;
return
written
;
}
...
...
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