X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_storage.c;h=cfd116f9791bc536ae2e5709ddc066a3d84f3d8e;hb=HEAD;hp=213ec2d6872825cda21173ff15a13bfd8d6a5a6b;hpb=45b00da14ea814cf8f14dcb2cfaccaddd0fbb38d;p=fw%2Faltos diff --git a/src/kernel/ao_storage.c b/src/kernel/ao_storage.c index 213ec2d6..a2c3738d 100644 --- a/src/kernel/ao_storage.c +++ b/src/kernel/ao_storage.c @@ -39,7 +39,7 @@ ao_storage_read(ao_pos_t pos, void *v_buf, uint16_t len) /* Compute portion of transfer within * a single block */ - this_off = (uint16_t) pos & (ao_storage_unit - 1); + this_off = (uint16_t) (pos & (ao_storage_unit - 1)); this_len = ao_storage_unit - this_off; if (this_len > len) this_len = len; @@ -70,7 +70,7 @@ ao_storage_write(ao_pos_t pos, void *v_buf, uint16_t len) /* Compute portion of transfer within * a single block */ - this_off = (uint16_t) pos & (ao_storage_unit - 1); + this_off = (uint16_t) (pos & (ao_storage_unit - 1)); this_len = ao_storage_unit - this_off; if (this_len > len) this_len = len; @@ -86,10 +86,6 @@ ao_storage_write(ao_pos_t pos, void *v_buf, uint16_t len) return 1; } -#ifndef AO_STORAGE_ERASED_BYTE -#define AO_STORAGE_ERASED_BYTE 0xff -#endif - uint8_t ao_storage_is_erased(uint32_t pos) { @@ -106,7 +102,7 @@ ao_storage_is_erased(uint32_t pos) uint32_t this_time = AO_STORAGE_DATA_SIZE; if (this_time > read_len) this_time = read_len; - if (!ao_storage_read(read_pos, storage_data, this_time)) { + if (!ao_storage_read(read_pos, storage_data, (uint16_t) this_time)) { ret = 0; goto done; }