Addressed copilot comments

pull/748/head
Daniele Lacamera 2026-04-14 17:11:15 +02:00
parent 9ac6b1f485
commit b007463103
3 changed files with 13 additions and 4 deletions

View File

@ -567,7 +567,7 @@ static int RAMFUNCTION wolfBoot_swap_and_final_erase(int resume)
# define DELTA_BLOCK_SIZE 1024
#endif
static inline uint32_t wb_im2n32(uint32_t val)
static inline uint32_t im2n(uint32_t val)
{
#ifdef BIG_ENDIAN_ORDER
return (((val & 0x000000FFU) << 24) |
@ -631,9 +631,9 @@ static int wolfBoot_delta_update(struct wolfBoot_image *boot,
&delta_base_hash, &delta_base_hash_sz) < 0) {
return -1;
}
delta_img_size = wb_im2n32(*img_size);
delta_img_size = im2n(*img_size);
if (inverse)
delta_img_offset = wb_im2n32(*img_offset);
delta_img_offset = im2n(*img_offset);
cur_v = wolfBoot_current_firmware_version();
upd_v = wolfBoot_update_firmware_version();
delta_base_v = wolfBoot_get_diffbase_version(PART_UPDATE);

View File

@ -431,8 +431,10 @@ int sata_unlock_disk(int drv, int freeze)
ata_st = ata_security_get_state(drv);
wolfBoot_printf("ATA: Security state SEC%d\r\n", ata_st);
#if defined(TARGET_x86_fsp_qemu)
if (ata_st == ATA_SEC0)
if (ata_st == ATA_SEC0) {
r = 0;
goto cleanup;
}
#endif
if (ata_st == ATA_SEC1) {
AHCI_DEBUG_PRINTF("ATA: calling set passphrase\r\n", r);

View File

@ -25,9 +25,12 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#if defined(__unix__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define HAVE_POSIX_FORK 1
#endif
#include "delta.h"
#define WC_RSA_BLINDING
@ -485,6 +488,7 @@ END_TEST
START_TEST(test_wb_diff_get_sector_size_rejects_values_above_16bit)
{
#if HAVE_POSIX_FORK
const char *saved = getenv("WOLFBOOT_SECTOR_SIZE");
char *saved_copy = saved ? strdup(saved) : NULL;
pid_t pid;
@ -510,6 +514,9 @@ START_TEST(test_wb_diff_get_sector_size_rejects_values_above_16bit)
else {
ck_assert_int_eq(unsetenv("WOLFBOOT_SECTOR_SIZE"), 0);
}
#else
ck_assert_int_eq(1, 1);
#endif
}
END_TEST