Commit f254bd02a0754402feaed2e5ec5aba4c5f1512e1

Authored by Sam Protsenko
Committed by Tom Rini
1 parent 6948f1023f

avb: Fix build when CONFIG_OPTEE_TA_AVB is disabled

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 <semen.protsenko@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -851,6 +851,7 @@
851 851 return AVB_IO_RESULT_OK;
852 852 }
853 853  
  854 +#ifdef CONFIG_OPTEE_TA_AVB
854 855 static AvbIOResult read_persistent_value(AvbOps *ops,
855 856 const char *name,
856 857 size_t buffer_size,
... ... @@ -968,6 +969,8 @@
968 969  
969 970 return rc;
970 971 }
  972 +#endif
  973 +
971 974 /**
972 975 * ============================================================================
973 976 * AVB2.0 AvbOps alloc/initialisation/free