mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-07-20 13:48:54 -04:00
fw: Remove unneeded variable
Instead of assigning error to a variable, just include the function returning the error in the if case.
This commit is contained in:
parent
0692dddbae
commit
9d1bbffbaa
1 changed files with 7 additions and 10 deletions
|
@ -93,8 +93,8 @@ int storage_allocate_area(struct partition_table_storage *part_table_storage)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t start_address = 0;
|
uint32_t start_address = 0;
|
||||||
int err = index_to_address(index, &start_address);
|
|
||||||
if (err) {
|
if (index_to_address(index, &start_address) != 0) {
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,8 +134,7 @@ int storage_deallocate_area(struct partition_table_storage *part_table_storage)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t start_address = 0;
|
uint32_t start_address = 0;
|
||||||
int err = index_to_address(index, &start_address);
|
if (index_to_address(index, &start_address) != 0) {
|
||||||
if (err) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,8 +179,7 @@ int storage_erase_sector(struct partition_table *part_table, uint32_t offset,
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t start_address = 0;
|
uint32_t start_address = 0;
|
||||||
int err = index_to_address(index, &start_address);
|
if (index_to_address(index, &start_address) != 0) {
|
||||||
if (err) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,8 +239,7 @@ int storage_write_data(struct partition_table *part_table, uint32_t offset,
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t start_address = 0;
|
uint32_t start_address = 0;
|
||||||
int err = index_to_address(index, &start_address);
|
if (index_to_address(index, &start_address) != 0) {
|
||||||
if (err) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +288,8 @@ int storage_read_data(struct partition_table *part_table, uint32_t offset,
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t start_address = 0;
|
uint32_t start_address = 0;
|
||||||
int err = index_to_address(index, &start_address);
|
|
||||||
if (err) {
|
if (index_to_address(index, &start_address) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue