Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
275084cb
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
275084cb
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aha152x: switch to ->show_info()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
31491e1a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
49 deletion
+12
-49
drivers/scsi/aha152x.c
drivers/scsi/aha152x.c
+12
-49
未找到文件。
drivers/scsi/aha152x.c
浏览文件 @
275084cb
...
...
@@ -2977,11 +2977,10 @@ static void show_queues(struct Scsi_Host *shpnt)
}
#undef SPRINTF
#define SPRINTF(args...)
pos += sprintf(pos, ##
args)
#define SPRINTF(args...)
seq_printf(m, ##
args)
static
int
get_command
(
char
*
pos
,
Scsi_Cmnd
*
ptr
)
static
void
get_command
(
struct
seq_file
*
m
,
Scsi_Cmnd
*
ptr
)
{
char
*
start
=
pos
;
int
i
;
SPRINTF
(
"%p: target=%d; lun=%d; cmnd=( "
,
...
...
@@ -3011,13 +3010,10 @@ static int get_command(char *pos, Scsi_Cmnd * ptr)
if
(
ptr
->
SCp
.
phase
&
syncneg
)
SPRINTF
(
"syncneg|"
);
SPRINTF
(
"; next=0x%p
\n
"
,
SCNEXT
(
ptr
));
return
(
pos
-
start
);
}
static
int
get_ports
(
struct
Scsi_Host
*
shpnt
,
char
*
pos
)
static
void
get_ports
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
shpnt
)
{
char
*
start
=
pos
;
int
s
;
SPRINTF
(
"
\n
%s: %s(%s) "
,
CURRENT_SC
?
"on bus"
:
"waiting"
,
states
[
STATE
].
name
,
states
[
PREVSTATE
].
name
);
...
...
@@ -3273,11 +3269,9 @@ static int get_ports(struct Scsi_Host *shpnt, char *pos)
if
(
s
&
ENREQINIT
)
SPRINTF
(
"ENREQINIT "
);
SPRINTF
(
")
\n
"
);
return
(
pos
-
start
);
}
static
int
aha152x_set_info
(
char
*
buffer
,
int
length
,
struct
Scsi_Host
*
shpnt
)
static
int
aha152x_set_info
(
struct
Scsi_Host
*
shpnt
,
char
*
buffer
,
int
length
)
{
if
(
!
shpnt
||
!
buffer
||
length
<
8
||
strncmp
(
"aha152x "
,
buffer
,
8
)
!=
0
)
return
-
EINVAL
;
...
...
@@ -3320,26 +3314,11 @@ static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt)
return
length
;
}
#undef SPRINTF
#define SPRINTF(args...) \
do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0)
static
int
aha152x_proc_info
(
struct
Scsi_Host
*
shpnt
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
inout
)
static
int
aha152x_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
shpnt
)
{
int
i
;
char
*
pos
=
buffer
;
Scsi_Cmnd
*
ptr
;
unsigned
long
flags
;
int
thislength
;
DPRINTK
(
debug_procinfo
,
KERN_DEBUG
"aha152x_proc_info: buffer=%p offset=%ld length=%d hostno=%d inout=%d
\n
"
,
buffer
,
offset
,
length
,
shpnt
->
host_no
,
inout
);
if
(
inout
)
return
aha152x_set_info
(
buffer
,
length
,
shpnt
);
SPRINTF
(
AHA152X_REVID
"
\n
"
);
...
...
@@ -3392,25 +3371,25 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
if
(
ISSUE_SC
)
{
SPRINTF
(
"not yet issued commands:
\n
"
);
for
(
ptr
=
ISSUE_SC
;
ptr
;
ptr
=
SCNEXT
(
ptr
))
pos
+=
get_command
(
pos
,
ptr
);
get_command
(
m
,
ptr
);
}
else
SPRINTF
(
"no not yet issued commands
\n
"
);
DO_UNLOCK
(
flags
);
if
(
CURRENT_SC
)
{
SPRINTF
(
"current command:
\n
"
);
pos
+=
get_command
(
pos
,
CURRENT_SC
);
get_command
(
m
,
CURRENT_SC
);
}
else
SPRINTF
(
"no current command
\n
"
);
if
(
DISCONNECTED_SC
)
{
SPRINTF
(
"disconnected commands:
\n
"
);
for
(
ptr
=
DISCONNECTED_SC
;
ptr
;
ptr
=
SCNEXT
(
ptr
))
pos
+=
get_command
(
pos
,
ptr
);
get_command
(
m
,
ptr
);
}
else
SPRINTF
(
"no disconnected commands
\n
"
);
pos
+=
get_ports
(
shpnt
,
pos
);
get_ports
(
m
,
shpnt
);
#if defined(AHA152X_STAT)
SPRINTF
(
"statistics:
\n
"
...
...
@@ -3440,24 +3419,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
HOSTDATA
(
shpnt
)
->
time
[
i
]);
}
#endif
DPRINTK
(
debug_procinfo
,
KERN_DEBUG
"aha152x_proc_info: pos=%p
\n
"
,
pos
);
thislength
=
pos
-
(
buffer
+
offset
);
DPRINTK
(
debug_procinfo
,
KERN_DEBUG
"aha152x_proc_info: length=%d thislength=%d
\n
"
,
length
,
thislength
);
if
(
thislength
<
0
)
{
DPRINTK
(
debug_procinfo
,
KERN_DEBUG
"aha152x_proc_info: output too short
\n
"
);
*
start
=
NULL
;
return
0
;
}
thislength
=
thislength
<
length
?
thislength
:
length
;
DPRINTK
(
debug_procinfo
,
KERN_DEBUG
"aha152x_proc_info: return %d
\n
"
,
thislength
);
*
start
=
buffer
+
offset
;
return
thislength
<
length
?
thislength
:
length
;
return
0
;
}
static
int
aha152x_adjust_queue
(
struct
scsi_device
*
device
)
...
...
@@ -3470,7 +3432,8 @@ static struct scsi_host_template aha152x_driver_template = {
.
module
=
THIS_MODULE
,
.
name
=
AHA152X_REVID
,
.
proc_name
=
"aha152x"
,
.
proc_info
=
aha152x_proc_info
,
.
show_info
=
aha152x_show_info
,
.
write_info
=
aha152x_set_info
,
.
queuecommand
=
aha152x_queue
,
.
eh_abort_handler
=
aha152x_abort
,
.
eh_device_reset_handler
=
aha152x_device_reset
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录