Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
82f3952c
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
82f3952c
编写于
5月 21, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix handling of offsets in cris eeprom.c, get rid of fake on-stack files
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
4f0447b8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
14 deletion
+7
-14
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v10/drivers/eeprom.c
+7
-14
未找到文件。
arch/cris/arch-v10/drivers/eeprom.c
浏览文件 @
82f3952c
...
@@ -437,10 +437,7 @@ static loff_t eeprom_lseek(struct file * file, loff_t offset, int orig)
...
@@ -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
)
static
int
eeprom_read_buf
(
loff_t
addr
,
char
*
buf
,
int
count
)
{
{
struct
file
f
;
return
eeprom_read
(
NULL
,
buf
,
count
,
&
addr
);
f
.
f_pos
=
addr
;
return
eeprom_read
(
&
f
,
buf
,
count
,
&
addr
);
}
}
...
@@ -450,7 +447,7 @@ static int eeprom_read_buf(loff_t addr, char * buf, int count)
...
@@ -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
)
static
ssize_t
eeprom_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
off
)
{
{
int
read
=
0
;
int
read
=
0
;
unsigned
long
p
=
file
->
f_pos
;
unsigned
long
p
=
*
off
;
unsigned
char
page
;
unsigned
char
page
;
...
@@ -495,7 +492,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
...
@@ -495,7 +492,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
if
(
read
>
0
)
if
(
read
>
0
)
{
{
file
->
f_pos
+=
read
;
*
off
+=
read
;
}
}
mutex_unlock
(
&
eeprom
.
lock
);
mutex_unlock
(
&
eeprom
.
lock
);
...
@@ -506,11 +503,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
...
@@ -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
)
static
int
eeprom_write_buf
(
loff_t
addr
,
const
char
*
buf
,
int
count
)
{
{
struct
file
f
;
return
eeprom_write
(
NULL
,
buf
,
count
,
&
addr
);
f
.
f_pos
=
addr
;
return
eeprom_write
(
&
f
,
buf
,
count
,
&
addr
);
}
}
...
@@ -534,7 +527,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
...
@@ -534,7 +527,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
{
{
restart
=
0
;
restart
=
0
;
written
=
0
;
written
=
0
;
p
=
file
->
f_pos
;
p
=
*
off
;
while
(
(
written
<
count
)
&&
(
p
<
eeprom
.
size
))
while
(
(
written
<
count
)
&&
(
p
<
eeprom
.
size
))
...
@@ -660,10 +653,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
...
@@ -660,10 +653,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
}
/* for */
}
/* for */
mutex_unlock
(
&
eeprom
.
lock
);
mutex_unlock
(
&
eeprom
.
lock
);
if
(
written
==
0
&&
file
->
f_pos
>=
eeprom
.
size
){
if
(
written
==
0
&&
p
>=
eeprom
.
size
){
return
-
ENOSPC
;
return
-
ENOSPC
;
}
}
file
->
f_pos
+=
written
;
*
off
=
p
;
return
written
;
return
written
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录