mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
fw_stub: fix -Wunused-but-set-variable for firmware files
In case we are only embedding a single firmware image the variable
"parent" gets set but never used. Add checks for the number of files
for it and only print it out if we are exceeding the single file count.
This fixes -Wunused-but-set-variable warnings for the majority of
firmware files in the tree.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit b394e16ef0)
This commit is contained in:
parent
1a30549073
commit
84a0714792
1 changed files with 5 additions and 3 deletions
|
|
@ -151,8 +151,10 @@ for (file_i = 0; file_i < num_files; file_i++) {
|
|||
printc("\nstatic int\n"\
|
||||
modname "_fw_modevent(module_t mod, int type, void *unused)\
|
||||
{\
|
||||
const struct firmware *fp, *parent;\
|
||||
int error;\
|
||||
const struct firmware *fp;");
|
||||
if (num_files > 1)
|
||||
printc("\tconst struct firmware *parent;");
|
||||
printc("\tint error;\
|
||||
switch (type) {\
|
||||
case MOD_LOAD:\n");
|
||||
|
||||
|
|
@ -187,7 +189,7 @@ for (file_i = 0; file_i < num_files; file_i++) {
|
|||
|
||||
printc("\t\tif (fp == NULL)");
|
||||
printc("\t\t\tgoto fail_" file_i ";");
|
||||
if (file_i == 0)
|
||||
if (file_i == 0 && num_files > 1)
|
||||
printc("\t\tparent = fp;");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue