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
648bdbee
Commit
648bdbee
authored
Jan 06, 2013
by
Rafał Miłecki
Committed by
Artem Bityutskiy
Feb 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtd: bcm47xxpart: simplify size calculation to one loop
Signed-off-by:
Rafał Miłecki
<
zajec5@gmail.com
>
parent
55bf75b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
drivers/mtd/bcm47xxpart.c
drivers/mtd/bcm47xxpart.c
+6
-5
No files found.
drivers/mtd/bcm47xxpart.c
View file @
648bdbee
...
@@ -169,11 +169,12 @@ static int bcm47xxpart_parse(struct mtd_info *master,
...
@@ -169,11 +169,12 @@ static int bcm47xxpart_parse(struct mtd_info *master,
* Assume that partitions end at the beginning of the one they are
* Assume that partitions end at the beginning of the one they are
* followed by.
* followed by.
*/
*/
for
(
i
=
0
;
i
<
curr_part
-
1
;
i
++
)
for
(
i
=
0
;
i
<
curr_part
;
i
++
)
{
parts
[
i
].
size
=
parts
[
i
+
1
].
offset
-
parts
[
i
].
offset
;
u64
next_part_offset
=
(
i
<
curr_part
-
1
)
?
if
(
curr_part
>
0
)
parts
[
i
+
1
].
offset
:
master
->
size
;
parts
[
curr_part
-
1
].
size
=
master
->
size
-
parts
[
curr_part
-
1
].
offset
;
parts
[
i
].
size
=
next_part_offset
-
parts
[
i
].
offset
;
}
*
pparts
=
parts
;
*
pparts
=
parts
;
return
curr_part
;
return
curr_part
;
...
...
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