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
nexedi
linux
Commits
b41e9c7b
Commit
b41e9c7b
authored
Jul 29, 2008
by
Pierre Ossman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmc_block: use proper sg iterators
Signed-off-by:
Pierre Ossman
<
drzeus@drzeus.cx
>
parent
a84756c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
drivers/mmc/card/block.c
drivers/mmc/card/block.c
+11
-6
No files found.
drivers/mmc/card/block.c
View file @
b41e9c7b
...
@@ -213,7 +213,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
...
@@ -213,7 +213,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
struct
mmc_blk_data
*
md
=
mq
->
data
;
struct
mmc_blk_data
*
md
=
mq
->
data
;
struct
mmc_card
*
card
=
md
->
queue
.
card
;
struct
mmc_card
*
card
=
md
->
queue
.
card
;
struct
mmc_blk_request
brq
;
struct
mmc_blk_request
brq
;
int
ret
=
1
,
sg_pos
,
data_size
;
int
ret
=
1
,
data_size
,
i
;
struct
scatterlist
*
sg
;
mmc_claim_host
(
card
->
host
);
mmc_claim_host
(
card
->
host
);
...
@@ -267,18 +268,22 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
...
@@ -267,18 +268,22 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
mmc_queue_bounce_pre
(
mq
);
mmc_queue_bounce_pre
(
mq
);
/*
* Adjust the sg list so it is the same size as the
* request.
*/
if
(
brq
.
data
.
blocks
!=
if
(
brq
.
data
.
blocks
!=
(
req
->
nr_sectors
>>
(
md
->
block_bits
-
9
)))
{
(
req
->
nr_sectors
>>
(
md
->
block_bits
-
9
)))
{
data_size
=
brq
.
data
.
blocks
*
brq
.
data
.
blksz
;
data_size
=
brq
.
data
.
blocks
*
brq
.
data
.
blksz
;
for
(
sg_pos
=
0
;
sg_pos
<
brq
.
data
.
sg_len
;
sg_pos
++
)
{
for
_each_sg
(
brq
.
data
.
sg
,
sg
,
brq
.
data
.
sg_len
,
i
)
{
data_size
-=
mq
->
sg
[
sg_pos
].
length
;
data_size
-=
sg
->
length
;
if
(
data_size
<=
0
)
{
if
(
data_size
<=
0
)
{
mq
->
sg
[
sg_pos
].
length
+=
data_size
;
sg
->
length
+=
data_size
;
sg_pos
++
;
i
++
;
break
;
break
;
}
}
}
}
brq
.
data
.
sg_len
=
sg_pos
;
brq
.
data
.
sg_len
=
i
;
}
}
mmc_wait_for_req
(
card
->
host
,
&
brq
.
mrq
);
mmc_wait_for_req
(
card
->
host
,
&
brq
.
mrq
);
...
...
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