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
Kirill Smelkov
linux
Commits
0a23a9c0
Commit
0a23a9c0
authored
Feb 08, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmapool: fix up list_for_each() calls to list_for_each_entry()
Now this should get that Rusty^Wmonkey off my back...
parent
64b7907f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
drivers/base/dmapool.c
drivers/base/dmapool.c
+11
-18
No files found.
drivers/base/dmapool.c
View file @
0a23a9c0
...
...
@@ -43,9 +43,11 @@ static DECLARE_MUTEX (pools_lock);
static
ssize_t
show_pools
(
struct
device
*
dev
,
char
*
buf
)
{
unsigned
temp
,
size
;
char
*
next
;
struct
list_head
*
i
,
*
j
;
unsigned
temp
;
unsigned
size
;
char
*
next
;
struct
dma_page
*
page
;
struct
dma_pool
*
pool
;
next
=
buf
;
size
=
PAGE_SIZE
;
...
...
@@ -55,16 +57,11 @@ show_pools (struct device *dev, char *buf)
next
+=
temp
;
down
(
&
pools_lock
);
list_for_each
(
i
,
&
dev
->
dma_
pools
)
{
struct
dma_pool
*
pool
;
unsigned
pages
=
0
,
blocks
=
0
;
list_for_each
_entry
(
pool
,
&
dev
->
dma_pools
,
pools
)
{
unsigned
pages
=
0
;
unsigned
blocks
=
0
;
pool
=
list_entry
(
i
,
struct
dma_pool
,
pools
);
list_for_each
(
j
,
&
pool
->
page_list
)
{
struct
dma_page
*
page
;
page
=
list_entry
(
j
,
struct
dma_page
,
page_list
);
list_for_each_entry
(
page
,
&
pool
->
page_list
,
page_list
)
{
pages
++
;
blocks
+=
page
->
in_use
;
}
...
...
@@ -268,7 +265,6 @@ void *
dma_pool_alloc
(
struct
dma_pool
*
pool
,
int
mem_flags
,
dma_addr_t
*
handle
)
{
unsigned
long
flags
;
struct
list_head
*
entry
;
struct
dma_page
*
page
;
int
map
,
block
;
size_t
offset
;
...
...
@@ -276,9 +272,8 @@ dma_pool_alloc (struct dma_pool *pool, int mem_flags, dma_addr_t *handle)
restart:
spin_lock_irqsave
(
&
pool
->
lock
,
flags
);
list_for_each
(
entry
,
&
pool
->
page_list
)
{
list_for_each
_entry
(
page
,
&
pool
->
page_list
,
page_list
)
{
int
i
;
page
=
list_entry
(
entry
,
struct
dma_page
,
page_list
);
/* only cachable accesses here ... */
for
(
map
=
0
,
i
=
0
;
i
<
pool
->
blocks_per_page
;
...
...
@@ -330,12 +325,10 @@ static struct dma_page *
pool_find_page
(
struct
dma_pool
*
pool
,
dma_addr_t
dma
)
{
unsigned
long
flags
;
struct
list_head
*
entry
;
struct
dma_page
*
page
;
spin_lock_irqsave
(
&
pool
->
lock
,
flags
);
list_for_each
(
entry
,
&
pool
->
page_list
)
{
page
=
list_entry
(
entry
,
struct
dma_page
,
page_list
);
list_for_each_entry
(
page
,
&
pool
->
page_list
,
page_list
)
{
if
(
dma
<
page
->
dma
)
continue
;
if
(
dma
<
(
page
->
dma
+
pool
->
allocation
))
...
...
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