avb: Fix build when CONFIG_OPTEE_TA_AVB is disabled
authorSam Protsenko <semen.protsenko@linaro.org>
Wed, 31 Jul 2019 16:59:08 +0000 (19:59 +0300)
committerTom Rini <trini@konsulko.com>
Wed, 7 Aug 2019 19:31:04 +0000 (15:31 -0400)
commitf254bd02a0754402feaed2e5ec5aba4c5f1512e1
tree82f351885cb8c3be189bb8df94e3afaeb1edf9ed
parent6948f1023f3aa382bb023f115929ab3106edb7ee
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>
common/avb_verify.c