chipset: fix warnings

This commit is contained in:
Matthias Ringwald 2024-12-05 15:10:51 +01:00
parent 04405944da
commit 5449042e9f
3 changed files with 8 additions and 5 deletions

View File

@ -113,6 +113,7 @@ static char matched_file[1000];
static void chipset_init(const void * config){
UNUSED(config);
if (hcd_file_path){
log_info("chipset-bcm: init file %s", hcd_file_path);
} else {
@ -159,7 +160,7 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){
init_script_offset += 3;
// read parameters
int param_len = hci_cmd_buffer[2];
size_t param_len = hci_cmd_buffer[2];
if (param_len){
bytes_read = fread(&hci_cmd_buffer[3], 1, param_len, hcd_file);
}
@ -229,6 +230,7 @@ void btstack_chipset_bcm_set_device_name(const char * device_name){
#else
static void chipset_init(const void * config){
UNUSED(config);
log_info("chipset-bcm: init script %s, len %u", brcm_patch_version, brcm_patch_ram_length);
init_script_offset = 0;
send_download_command = 1;

View File

@ -177,7 +177,7 @@ static void chipset_set_bd_addr_command(bd_addr_t addr, uint8_t *hci_cmd_buffer)
static void chipset_set_baudrate_command(uint32_t baudrate, uint8_t *hci_cmd_buffer){
// lookup baudrates
int i;
unsigned i;
int found = 0;
for (i=0 ; i < sizeof(baudrates)/sizeof(uint32_t) ; i++){
if (baudrates[i] == baudrate){

View File

@ -653,6 +653,7 @@ static uint8_t *rtb_get_patch_header(uint32_t *len,
btstack_linked_list_t * patch_list, uint8_t * epatch_buf,
uint8_t key_id)
{
UNUSED(key_id);
uint16_t i, j;
struct rtb_new_patch_hdr *new_patch;
uint8_t sec_flag = 0;
@ -781,7 +782,7 @@ static uint8_t update_firmware(const char *firmware, const char *config, uint8_t
// read firmware and config
if (patch_buf == NULL) {
uint16_t patch_length = 0;
uint32_t offset;
uint32_t offset = 0;
FILE * fw = NULL;
uint32_t fw_size;
uint8_t *fw_buf = NULL;
@ -794,7 +795,7 @@ static uint8_t update_firmware(const char *firmware, const char *config, uint8_t
uint16_t fw_num_patches;
struct patch_node *tmp;
int max_patch_size = 0;
unsigned max_patch_size = 0;
if (firmware == NULL || config == NULL) {
log_info("Please specify realtek firmware and config file paths");
@ -835,7 +836,7 @@ static uint8_t update_firmware(const char *firmware, const char *config, uint8_t
if (have_new_firmware_signature){
printf("Realtek: Using new signature\n");
uint8_t key_id = g_key_id;
if (key_id < 0) {
if (key_id == 0) {
log_info("Wrong key id. Quit!");
finalize_file_and_buffer(&fw, &fw_buf);
finalize_file_and_buffer(&conf, &conf_buf);