From 72ef2086b599f35ae7c7eaeeaa972dbb1a7743ce Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 29 Sep 2020 11:23:20 +0200 Subject: [PATCH] suit: Group the HAVE_COMPONENTS flag with the others --- sys/include/suit.h | 17 +++++++++-------- sys/suit/handlers_common.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/include/suit.h b/sys/include/suit.h index f0765e5a6f..2f217671bb 100644 --- a/sys/include/suit.h +++ b/sys/include/suit.h @@ -70,6 +70,11 @@ extern "C" { * These flags apply to the full manifest. * @{ */ +/** + * @brief Bit flags used to determine if SUIT manifest contains components + */ +#define SUIT_STATE_HAVE_COMPONENTS (1 << 0) + /** * @brief COSE signature OK */ @@ -178,10 +183,10 @@ typedef struct { * These state flags apply to individual components inside a manifest. * @{ */ -#define SUIT_COMPONENT_STATE_FETCHED 0x01 /**< Component is fetched */ -#define SUIT_COMPONENT_STATE_FETCH_FAILED 0x02 /**< Component fetched but failed */ -#define SUIT_COMPONENT_STATE_VERIFIED 0x04 /**< Component is verified */ -#define SUIT_COMPONENT_STATE_FINALIZED 0x08 /**< Component successfully installed */ +#define SUIT_COMPONENT_STATE_FETCHED (1 << 0) /**< Component is fetched */ +#define SUIT_COMPONENT_STATE_FETCH_FAILED (1 << 1) /**< Component fetched but failed */ +#define SUIT_COMPONENT_STATE_VERIFIED (1 << 2) /**< Component is verified */ +#define SUIT_COMPONENT_STATE_FINALIZED (1 << 3) /**< Component successfully installed */ /** @} */ /** @@ -225,10 +230,6 @@ typedef struct { size_t urlbuf_len; /**< Length of the manifest url */ } suit_manifest_t; -/** - * @brief Bit flags used to determine if SUIT manifest contains components - */ -#define SUIT_MANIFEST_HAVE_COMPONENTS (0x1) /** * @brief Component index representing all components diff --git a/sys/suit/handlers_common.c b/sys/suit/handlers_common.c index 06ee864d98..aee3cbc75d 100644 --- a/sys/suit/handlers_common.c +++ b/sys/suit/handlers_common.c @@ -76,7 +76,7 @@ static int _component_handler(suit_manifest_t *manifest, int key, } manifest->components_len = n; if (n) { - manifest->state |= SUIT_MANIFEST_HAVE_COMPONENTS; + manifest->state |= SUIT_STATE_HAVE_COMPONENTS; } return 0; }