Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broadcom-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Broadcom
broadcom-utils
Commits
bc16423b
Commit
bc16423b
authored
5 years ago
by
Ronny Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Use a constant define for volume id where appropriate.
parent
9a5233cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
brcm_fw_tool/image-ubi.c
+8
-8
8 additions, 8 deletions
brcm_fw_tool/image-ubi.c
with
8 additions
and
8 deletions
brcm_fw_tool/image-ubi.c
+
8
−
8
View file @
bc16423b
...
@@ -143,7 +143,7 @@ static char* ubi_path_by_id(int devId, int volId)
...
@@ -143,7 +143,7 @@ static char* ubi_path_by_id(int devId, int volId)
}
}
dstPath
[
DST_LEN
-
1
]
=
0
;
dstPath
[
DST_LEN
-
1
]
=
0
;
if
(
volId
==
-
1
)
return
dstPath
;
if
(
volId
==
METAINVALID
)
return
dstPath
;
/* If the volume is supposed to exsit; verify it does.
/* If the volume is supposed to exsit; verify it does.
* Otherwise; verify it does NOT exist. */
* Otherwise; verify it does NOT exist. */
...
@@ -218,7 +218,7 @@ int ubi_erase_volume(int volId)
...
@@ -218,7 +218,7 @@ int ubi_erase_volume(int volId)
return
-
1
;
return
-
1
;
}
}
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
METAINVALID
);
if
(
ubi_rmvol
(
libubi
,
nodePath
,
volId
)
&&
errno
!=
ENOENT
)
{
if
(
ubi_rmvol
(
libubi
,
nodePath
,
volId
)
&&
errno
!=
ENOENT
)
{
fprintf
(
stderr
,
"Error deleting volume %d: %s
\n
"
,
volId
,
strerror
(
errno
));
fprintf
(
stderr
,
"Error deleting volume %d: %s
\n
"
,
volId
,
strerror
(
errno
));
free
(
nodePath
);
free
(
nodePath
);
...
@@ -251,7 +251,7 @@ int ubi_create_volume(int volId, long long size)
...
@@ -251,7 +251,7 @@ int ubi_create_volume(int volId, long long size)
mkReq
.
bytes
=
size
;
mkReq
.
bytes
=
size
;
mkReq
.
vol_type
=
UBI_STATIC_VOLUME
;
mkReq
.
vol_type
=
UBI_STATIC_VOLUME
;
mkReq
.
name
=
name
;
mkReq
.
name
=
name
;
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
METAINVALID
);
errno
=
0
;
errno
=
0
;
if
(
ubi_mkvol
(
libubi
,
nodePath
,
&
mkReq
))
{
if
(
ubi_mkvol
(
libubi
,
nodePath
,
&
mkReq
))
{
...
@@ -423,7 +423,7 @@ static int ubi_rename_volume(int volId, const char *name)
...
@@ -423,7 +423,7 @@ static int ubi_rename_volume(int volId, const char *name)
rnvol
.
ents
[
0
].
name_len
=
strlen
(
name
);
rnvol
.
ents
[
0
].
name_len
=
strlen
(
name
);
strncpy
(
rnvol
.
ents
[
0
].
name
,
name
,
UBI_MAX_VOLUME_NAME
+
1
);
strncpy
(
rnvol
.
ents
[
0
].
name
,
name
,
UBI_MAX_VOLUME_NAME
+
1
);
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
METAINVALID
);
if
(
!
nodePath
||
ubi_rnvols
(
libubi
,
nodePath
,
&
rnvol
))
{
if
(
!
nodePath
||
ubi_rnvols
(
libubi
,
nodePath
,
&
rnvol
))
{
fprintf
(
stderr
,
"Error renaming %d to %s: %s
\n
"
,
volId
,
fprintf
(
stderr
,
"Error renaming %d to %s: %s
\n
"
,
volId
,
...
@@ -593,7 +593,7 @@ static int meta_find_all(void)
...
@@ -593,7 +593,7 @@ static int meta_find_all(void)
case
METAVOLID3
:
case
METAVOLID3
:
metaInfos
[
medaIdx
].
found
=
1
;
metaInfos
[
medaIdx
].
found
=
1
;
metaInfos
[
medaIdx
].
volInfo
=
volInfo
;
metaInfos
[
medaIdx
].
volInfo
=
volInfo
;
metaInfos
[
medaIdx
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
metaInfos
[
medaIdx
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
METAINVALID
);
metaInfos
[
medaIdx
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
metaInfos
[
medaIdx
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
if
(
meta_find_seqno
(
metaInfos
+
medaIdx
))
{
if
(
meta_find_seqno
(
metaInfos
+
medaIdx
))
{
if
(
verbose
)
{
if
(
verbose
)
{
...
@@ -806,7 +806,7 @@ static int meta_manage_vols(int readonly)
...
@@ -806,7 +806,7 @@ static int meta_manage_vols(int readonly)
}
}
else
{
else
{
newMeta
=
METAVOLID2
;
newMeta
=
METAVOLID2
;
delMeta
=
-
1
;
delMeta
=
METAINVALID
;
}
}
newBank
=
1
;
newBank
=
1
;
break
;
break
;
...
@@ -822,7 +822,7 @@ static int meta_manage_vols(int readonly)
...
@@ -822,7 +822,7 @@ static int meta_manage_vols(int readonly)
}
}
else
{
else
{
newMeta
=
METAVOLID0
;
newMeta
=
METAVOLID0
;
delMeta
=
-
1
;
delMeta
=
METAINVALID
;
}
}
newBank
=
0
;
newBank
=
0
;
break
;
break
;
...
@@ -831,7 +831,7 @@ static int meta_manage_vols(int readonly)
...
@@ -831,7 +831,7 @@ static int meta_manage_vols(int readonly)
if
(
verbose
)
{
if
(
verbose
)
{
printf
(
"Highest sequence number found is %d.
\n
"
,
highSeqNo
);
printf
(
"Highest sequence number found is %d.
\n
"
,
highSeqNo
);
printf
(
"Will create volume %d"
,
newMeta
);
printf
(
"Will create volume %d"
,
newMeta
);
if
(
delMeta
>
=
0
)
printf
(
" to replace volume %d"
,
delMeta
);
if
(
delMeta
!
=
METAINVALID
)
printf
(
" to replace volume %d"
,
delMeta
);
printf
(
" in flash bank %d.
\n
"
,
newBank
);
printf
(
" in flash bank %d.
\n
"
,
newBank
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment