Skip to content

Commit

Permalink
avb: Fix build when CONFIG_OPTEE_TA_AVB is disabled
Browse files Browse the repository at this point in the history
When having only these AVB related configs enabled:

    CONFIG_AVB_VERIFY=y
    CONFIG_CMD_AVB=y
    CONFIG_LIBAVB=y

build fails with next errors:

    common/avb_verify.c: In function 'read_persistent_value':
    common/avb_verify.c:867:6: warning: implicit declaration of function
                                        'get_open_session'
    common/avb_verify.c:870:45: error: 'struct AvbOpsData' has no member
                                        named 'tee'
    common/avb_verify.c:894:7: warning: implicit declaration of function
                                        'invoke_func'
    common/avb_verify.c: In function 'write_persistent_value':
    common/avb_verify.c:931:45: error: 'struct AvbOpsData' has no member
                                       named 'tee'

Guard read_persistent_value() and write_persistent_value() functions
by checking if CONFIG_OPTEE_TA_AVB is enabled (as those are only used in
that case) to fix the build with mentioned configuration.

Signed-off-by: Sam Protsenko <[email protected]>
Reviewed-by: Igor Opaniuk <[email protected]>
  • Loading branch information
Sam Protsenko authored and trini committed Aug 7, 2019
1 parent 6948f10 commit f254bd0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/avb_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static AvbIOResult get_size_of_partition(AvbOps *ops,
return AVB_IO_RESULT_OK;
}

#ifdef CONFIG_OPTEE_TA_AVB
static AvbIOResult read_persistent_value(AvbOps *ops,
const char *name,
size_t buffer_size,
Expand Down Expand Up @@ -968,6 +969,8 @@ static AvbIOResult write_persistent_value(AvbOps *ops,

return rc;
}
#endif

/**
* ============================================================================
* AVB2.0 AvbOps alloc/initialisation/free
Expand Down

0 comments on commit f254bd0

Please sign in to comment.