Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
79bf7fc5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79bf7fc5
编写于
12月 20, 2013
作者:
B
Bjorn Helgaas
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pci/misc' into next
* pci/misc: PCI/checkpatch: Deprecate DEFINE_PCI_DEVICE_TABLE
上级
47e0ab3f
92e112fd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
8 deletion
+12
-8
Documentation/PCI/pci.txt
Documentation/PCI/pci.txt
+4
-2
include/linux/pci.h
include/linux/pci.h
+1
-2
scripts/checkpatch.pl
scripts/checkpatch.pl
+7
-4
未找到文件。
Documentation/PCI/pci.txt
浏览文件 @
79bf7fc5
...
@@ -123,8 +123,10 @@ initialization with a pointer to a structure describing the driver
...
@@ -123,8 +123,10 @@ initialization with a pointer to a structure describing the driver
The ID table is an array of struct pci_device_id entries ending with an
The ID table is an array of struct pci_device_id entries ending with an
all-zero entry; use of the macro DEFINE_PCI_DEVICE_TABLE is the preferred
all-zero entry. Definitions with static const are generally preferred.
method of declaring the table. Each entry consists of:
Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided.
Each entry consists of:
vendor,device Vendor and device ID to match (or PCI_ANY_ID)
vendor,device Vendor and device ID to match (or PCI_ANY_ID)
...
...
include/linux/pci.h
浏览文件 @
79bf7fc5
...
@@ -635,8 +635,7 @@ struct pci_driver {
...
@@ -635,8 +635,7 @@ struct pci_driver {
* DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
* DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
* @_table: device table name
* @_table: device table name
*
*
* This macro is used to create a struct pci_device_id array (a device table)
* This macro is deprecated and should not be used in new code.
* in a generic manner.
*/
*/
#define DEFINE_PCI_DEVICE_TABLE(_table) \
#define DEFINE_PCI_DEVICE_TABLE(_table) \
const struct pci_device_id _table[]
const struct pci_device_id _table[]
...
...
scripts/checkpatch.pl
浏览文件 @
79bf7fc5
...
@@ -2634,10 +2634,13 @@ sub process {
...
@@ -2634,10 +2634,13 @@ sub process {
$herecurr
);
$herecurr
);
}
}
# check for declarations of struct pci_device_id
# check for uses of DEFINE_PCI_DEVICE_TABLE
if
(
$line
=~
/\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/
)
{
if
(
$line
=~
/\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/
)
{
WARN
("
DEFINE_PCI_DEVICE_TABLE
",
if
(
WARN
("
DEFINE_PCI_DEVICE_TABLE
",
"
Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id
\n
"
.
$herecurr
);
"
Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE
\n
"
.
$herecurr
)
&&
$fix
)
{
$fixed
[
$linenr
-
1
]
=~
s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /
;
}
}
}
# check for new typedefs, only function parameters and sparse annotations
# check for new typedefs, only function parameters and sparse annotations
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录