Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0ea27d9f
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,发现更多精彩内容 >>
提交
0ea27d9f
编写于
10月 20, 2005
作者:
D
Dave Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[AGPGART] Replace kmalloc+memset's with kzalloc's
Signed-off-by:
N
Dave Jones
<
davej@redhat.com
>
上级
0ff541da
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
37 deletion
+18
-37
drivers/char/agp/amd-k7-agp.c
drivers/char/agp/amd-k7-agp.c
+2
-5
drivers/char/agp/ati-agp.c
drivers/char/agp/ati-agp.c
+2
-5
drivers/char/agp/backend.c
drivers/char/agp/backend.c
+3
-3
drivers/char/agp/frontend.c
drivers/char/agp/frontend.c
+4
-11
drivers/char/agp/generic.c
drivers/char/agp/generic.c
+1
-3
drivers/char/agp/i460-agp.c
drivers/char/agp/i460-agp.c
+2
-4
drivers/char/agp/sworks-agp.c
drivers/char/agp/sworks-agp.c
+4
-6
未找到文件。
drivers/char/agp/amd-k7-agp.c
浏览文件 @
0ea27d9f
...
...
@@ -94,19 +94,16 @@ static int amd_create_gatt_pages(int nr_tables)
int
retval
=
0
;
int
i
;
tables
=
kmalloc
((
nr_tables
+
1
)
*
sizeof
(
struct
amd_page_map
*
),
GFP_KERNEL
);
tables
=
kzalloc
((
nr_tables
+
1
)
*
sizeof
(
struct
amd_page_map
*
),
GFP_KERNEL
);
if
(
tables
==
NULL
)
return
-
ENOMEM
;
memset
(
tables
,
0
,
sizeof
(
struct
amd_page_map
*
)
*
(
nr_tables
+
1
));
for
(
i
=
0
;
i
<
nr_tables
;
i
++
)
{
entry
=
k
m
alloc
(
sizeof
(
struct
amd_page_map
),
GFP_KERNEL
);
entry
=
k
z
alloc
(
sizeof
(
struct
amd_page_map
),
GFP_KERNEL
);
if
(
entry
==
NULL
)
{
retval
=
-
ENOMEM
;
break
;
}
memset
(
entry
,
0
,
sizeof
(
struct
amd_page_map
));
tables
[
i
]
=
entry
;
retval
=
amd_create_page_map
(
entry
);
if
(
retval
!=
0
)
...
...
drivers/char/agp/ati-agp.c
浏览文件 @
0ea27d9f
...
...
@@ -116,14 +116,12 @@ static int ati_create_gatt_pages(int nr_tables)
int
retval
=
0
;
int
i
;
tables
=
kmalloc
((
nr_tables
+
1
)
*
sizeof
(
ati_page_map
*
),
GFP_KERNEL
);
tables
=
kzalloc
((
nr_tables
+
1
)
*
sizeof
(
ati_page_map
*
),
GFP_KERNEL
);
if
(
tables
==
NULL
)
return
-
ENOMEM
;
memset
(
tables
,
0
,
sizeof
(
ati_page_map
*
)
*
(
nr_tables
+
1
));
for
(
i
=
0
;
i
<
nr_tables
;
i
++
)
{
entry
=
k
m
alloc
(
sizeof
(
ati_page_map
),
GFP_KERNEL
);
entry
=
k
z
alloc
(
sizeof
(
ati_page_map
),
GFP_KERNEL
);
if
(
entry
==
NULL
)
{
while
(
i
>
0
)
{
kfree
(
tables
[
i
-
1
]);
...
...
@@ -134,7 +132,6 @@ static int ati_create_gatt_pages(int nr_tables)
retval
=
-
ENOMEM
;
break
;
}
memset
(
entry
,
0
,
sizeof
(
ati_page_map
));
tables
[
i
]
=
entry
;
retval
=
ati_create_page_map
(
entry
);
if
(
retval
!=
0
)
break
;
...
...
drivers/char/agp/backend.c
浏览文件 @
0ea27d9f
...
...
@@ -222,12 +222,12 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
struct
agp_bridge_data
*
agp_alloc_bridge
(
void
)
{
struct
agp_bridge_data
*
bridge
=
kmalloc
(
sizeof
(
*
bridge
),
GFP_KERNEL
);
struct
agp_bridge_data
*
bridge
;
bridge
=
kzalloc
(
sizeof
(
*
bridge
),
GFP_KERNEL
);
if
(
!
bridge
)
return
NULL
;
memset
(
bridge
,
0
,
sizeof
(
*
bridge
));
atomic_set
(
&
bridge
->
agp_in_use
,
0
);
atomic_set
(
&
bridge
->
current_memory_agp
,
0
);
...
...
drivers/char/agp/frontend.c
浏览文件 @
0ea27d9f
...
...
@@ -189,13 +189,12 @@ static int agp_create_segment(struct agp_client *client, struct agp_region *regi
struct
agp_segment
*
user_seg
;
size_t
i
;
seg
=
k
m
alloc
((
sizeof
(
struct
agp_segment_priv
)
*
region
->
seg_count
),
GFP_KERNEL
);
seg
=
k
z
alloc
((
sizeof
(
struct
agp_segment_priv
)
*
region
->
seg_count
),
GFP_KERNEL
);
if
(
seg
==
NULL
)
{
kfree
(
region
->
seg_list
);
region
->
seg_list
=
NULL
;
return
-
ENOMEM
;
}
memset
(
seg
,
0
,
(
sizeof
(
struct
agp_segment_priv
)
*
region
->
seg_count
));
user_seg
=
region
->
seg_list
;
for
(
i
=
0
;
i
<
region
->
seg_count
;
i
++
)
{
...
...
@@ -332,14 +331,11 @@ static struct agp_controller *agp_create_controller(pid_t id)
{
struct
agp_controller
*
controller
;
controller
=
kmalloc
(
sizeof
(
struct
agp_controller
),
GFP_KERNEL
);
controller
=
kzalloc
(
sizeof
(
struct
agp_controller
),
GFP_KERNEL
);
if
(
controller
==
NULL
)
return
NULL
;
memset
(
controller
,
0
,
sizeof
(
struct
agp_controller
));
controller
->
pid
=
id
;
return
controller
;
}
...
...
@@ -540,12 +536,10 @@ static struct agp_client *agp_create_client(pid_t id)
{
struct
agp_client
*
new_client
;
new_client
=
kmalloc
(
sizeof
(
struct
agp_client
),
GFP_KERNEL
);
new_client
=
kzalloc
(
sizeof
(
struct
agp_client
),
GFP_KERNEL
);
if
(
new_client
==
NULL
)
return
NULL
;
memset
(
new_client
,
0
,
sizeof
(
struct
agp_client
));
new_client
->
pid
=
id
;
agp_insert_client
(
new_client
);
return
new_client
;
...
...
@@ -709,11 +703,10 @@ static int agp_open(struct inode *inode, struct file *file)
if
(
minor
!=
AGPGART_MINOR
)
goto
err_out
;
priv
=
k
m
alloc
(
sizeof
(
struct
agp_file_private
),
GFP_KERNEL
);
priv
=
k
z
alloc
(
sizeof
(
struct
agp_file_private
),
GFP_KERNEL
);
if
(
priv
==
NULL
)
goto
err_out_nomem
;
memset
(
priv
,
0
,
sizeof
(
struct
agp_file_private
));
set_bit
(
AGP_FF_ALLOW_CLIENT
,
&
priv
->
access_flags
);
priv
->
my_pid
=
current
->
pid
;
...
...
drivers/char/agp/generic.c
浏览文件 @
0ea27d9f
...
...
@@ -105,12 +105,10 @@ struct agp_memory *agp_create_memory(int scratch_pages)
{
struct
agp_memory
*
new
;
new
=
kmalloc
(
sizeof
(
struct
agp_memory
),
GFP_KERNEL
);
new
=
kzalloc
(
sizeof
(
struct
agp_memory
),
GFP_KERNEL
);
if
(
new
==
NULL
)
return
NULL
;
memset
(
new
,
0
,
sizeof
(
struct
agp_memory
));
new
->
key
=
agp_get_key
();
if
(
new
->
key
<
0
)
{
...
...
drivers/char/agp/i460-agp.c
浏览文件 @
0ea27d9f
...
...
@@ -225,10 +225,9 @@ static int i460_configure (void)
*/
if
(
I460_IO_PAGE_SHIFT
>
PAGE_SHIFT
)
{
size
=
current_size
->
num_entries
*
sizeof
(
i460
.
lp_desc
[
0
]);
i460
.
lp_desc
=
k
m
alloc
(
size
,
GFP_KERNEL
);
i460
.
lp_desc
=
k
z
alloc
(
size
,
GFP_KERNEL
);
if
(
!
i460
.
lp_desc
)
return
-
ENOMEM
;
memset
(
i460
.
lp_desc
,
0
,
size
);
}
return
0
;
}
...
...
@@ -364,13 +363,12 @@ static int i460_alloc_large_page (struct lp_desc *lp)
}
map_size
=
((
I460_KPAGES_PER_IOPAGE
+
BITS_PER_LONG
-
1
)
&
-
BITS_PER_LONG
)
/
8
;
lp
->
alloced_map
=
k
m
alloc
(
map_size
,
GFP_KERNEL
);
lp
->
alloced_map
=
k
z
alloc
(
map_size
,
GFP_KERNEL
);
if
(
!
lp
->
alloced_map
)
{
free_pages
((
unsigned
long
)
lpage
,
order
);
printk
(
KERN_ERR
PFX
"Out of memory, we're in trouble...
\n
"
);
return
-
ENOMEM
;
}
memset
(
lp
->
alloced_map
,
0
,
map_size
);
lp
->
paddr
=
virt_to_gart
(
lpage
);
lp
->
refcount
=
0
;
...
...
drivers/char/agp/sworks-agp.c
浏览文件 @
0ea27d9f
...
...
@@ -100,19 +100,17 @@ static int serverworks_create_gatt_pages(int nr_tables)
int
retval
=
0
;
int
i
;
tables
=
k
m
alloc
((
nr_tables
+
1
)
*
sizeof
(
struct
serverworks_page_map
*
),
tables
=
k
z
alloc
((
nr_tables
+
1
)
*
sizeof
(
struct
serverworks_page_map
*
),
GFP_KERNEL
);
if
(
tables
==
NULL
)
{
if
(
tables
==
NULL
)
return
-
ENOMEM
;
}
memset
(
tables
,
0
,
sizeof
(
struct
serverworks_page_map
*
)
*
(
nr_tables
+
1
));
for
(
i
=
0
;
i
<
nr_tables
;
i
++
)
{
entry
=
k
m
alloc
(
sizeof
(
struct
serverworks_page_map
),
GFP_KERNEL
);
entry
=
k
z
alloc
(
sizeof
(
struct
serverworks_page_map
),
GFP_KERNEL
);
if
(
entry
==
NULL
)
{
retval
=
-
ENOMEM
;
break
;
}
memset
(
entry
,
0
,
sizeof
(
struct
serverworks_page_map
));
tables
[
i
]
=
entry
;
retval
=
serverworks_create_page_map
(
entry
);
if
(
retval
!=
0
)
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录