Merge pull request #699 from mmichal10/alleviation-for-static-analysers

Alleviation for static analyzers
This commit is contained in:
Robert Baldyga 2022-04-11 17:31:32 +02:00 committed by GitHub
commit fa6c0f3573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -405,7 +405,7 @@ static void ocf_acp_recovery_chunk(struct ocf_acp_recovery_context *context,
.chunk[chunk->core_id][chunk->chunk_id];
}
for (bucket_id = 0; bucket_id < ACP_MAX_BUCKETS; bucket_id++) {
for (bucket_id = 1; bucket_id < ACP_MAX_BUCKETS; bucket_id++) {
bucket = &acp->bucket_info[bucket_id];
if (chunk->num_dirty < bucket->threshold)
break;

View File

@ -512,13 +512,13 @@ static int ocf_alru_recovery_handle(ocf_parallelize_t parallelize,
ocf_part_id_t part_id;
ocf_core_id_t core_id;
ocf_cache_line_t cline, portion;
uint64_t begin, end;
uint32_t begin, end;
uint32_t step = 0;
int i;
portion = DIV_ROUND_UP((uint64_t)entries, shards_cnt);
begin = portion*shard_id;
end = OCF_MIN(portion*(shard_id + 1), entries);
end = OCF_MIN((uint64_t)portion*(shard_id + 1), entries);
for (i = 0; i < OCF_USER_IO_CLASS_MAX; i++) {
context->shard[shard_id].part[i].head = terminator;