Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
d223f7de
Commit
d223f7de
authored
Feb 17, 2013
by
Pat Wood
Browse files
cosmetic change: got rid of "if (1 || ...)" tests and enclosing blocks
parent
7584b265
Changes
1
Hide whitespace changes
Inline
Side-by-side
nand-part.c
View file @
d223f7de
...
...
@@ -154,14 +154,11 @@ void checkmbrs(int fd)
for
(
part_cnt
=
0
;
part_cnt
<
mbr
->
PartCount
&&
part_cnt
<
MAX_PART_COUNT
;
part_cnt
++
)
{
if
(
1
||
(
mbr
->
array
[
part_cnt
].
user_type
==
2
)
||
(
mbr
->
array
[
part_cnt
].
user_type
==
0
))
{
printf
(
"partition %2d: name = %12s, partition start = %8d, partition size = %8d
\n
"
,
part_cnt
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
addrlo
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
printf
(
"partition %2d: name = %12s, partition start = %8d, partition size = %8d
\n
"
,
part_cnt
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
addrlo
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
for
(
i
=
0
;
i
<
MBR_COPY_NUM
;
i
++
)
{
if
(
mbrs
[
i
])
...
...
@@ -207,11 +204,8 @@ int writembrs(int fd, char names[][MAX_NAME], __u32 *lens, unsigned int *user_ty
for
(
part_cnt
=
1
;
part_cnt
<
mbr
->
PartCount
&&
part_cnt
<
MAX_PART_COUNT
;
part_cnt
++
)
{
if
(
1
||
(
mbr
->
array
[
part_cnt
].
user_type
==
2
)
||
(
mbr
->
array
[
part_cnt
].
user_type
==
0
))
{
fprintf
(
backup
,
"'%s %d' "
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
fprintf
(
backup
,
"'%s %d' "
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
fprintf
(
backup
,
"
\n
"
);
fclose
(
backup
);
...
...
@@ -235,14 +229,11 @@ int writembrs(int fd, char names[][MAX_NAME], __u32 *lens, unsigned int *user_ty
printf
(
"
\n
ready to write new partition tables:
\n
"
);
for
(
part_cnt
=
0
;
part_cnt
<
mbr
->
PartCount
&&
part_cnt
<
MAX_PART_COUNT
;
part_cnt
++
)
{
if
(
1
||
(
mbr
->
array
[
part_cnt
].
user_type
==
2
)
||
(
mbr
->
array
[
part_cnt
].
user_type
==
0
))
{
printf
(
"partition %2d: name = %12s, partition start = %8d, partition size = %8d
\n
"
,
part_cnt
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
addrlo
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
printf
(
"partition %2d: name = %12s, partition start = %8d, partition size = %8d
\n
"
,
part_cnt
,
mbr
->
array
[
part_cnt
].
name
,
mbr
->
array
[
part_cnt
].
addrlo
,
mbr
->
array
[
part_cnt
].
lenlo
);
}
for
(
i
=
0
;
i
<
MBR_COPY_NUM
;
i
++
)
{
if
(
mbrs
[
i
])
...
...
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