From 5af4a915edf3e77705fa2625081200b61f8dda26 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Sun, 15 Oct 2017 21:34:00 -0400 Subject: Cleanup: All drivers return HAL_StatusTypeDef rather than magic values. Note: This affects libhal/ks_token.c, which uses the keystore driver directly. --- projects/hsm/mgmt-bootloader.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'projects/hsm/mgmt-bootloader.c') diff --git a/projects/hsm/mgmt-bootloader.c b/projects/hsm/mgmt-bootloader.c index ce24560..1d8b8ad 100644 --- a/projects/hsm/mgmt-bootloader.c +++ b/projects/hsm/mgmt-bootloader.c @@ -50,12 +50,11 @@ extern hal_user_t user; static uint32_t dfu_offset; -static int _flash_write_callback(uint8_t *buf, size_t len) +static HAL_StatusTypeDef _flash_write_callback(uint8_t *buf, size_t len) { - if (stm_flash_write32(dfu_offset, (uint32_t *)buf, (uint32_t)len/4) != 1) - return 0; + HAL_StatusTypeDef status = stm_flash_write32(dfu_offset, (uint32_t *)buf, len/4); dfu_offset += DFU_UPLOAD_CHUNK_SIZE; - return 1; + return status; } static int cmd_bootloader_upload(struct cli_def *cli, const char *command, char *argv[], int argc) -- cgit v1.2.3