kernel: umem: fix img_get macro
The img_get macro used to subtract 1 to the argument provided before computing the porinter to the image. I can't remember why it did so. However the expression was wrong. Coverity found the issue: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) CID: 155616, 155606, 155598, 155597, 155596, 155587, 155580, 155578, 155577, 155576, 155568, 155566 Simply removing the subtraction seems the obvious fix.
This commit is contained in:
parent
b056df2da6
commit
0b8a66f877
@ -88,7 +88,7 @@ static RWlock pool_lock; /* to grow chunks or modify free list */
|
|||||||
static ImagePool pool;
|
static ImagePool pool;
|
||||||
|
|
||||||
#define img_hash(path) ((uint8_t)((path*(PSTEP+1))&(PSTEP-1)))
|
#define img_hash(path) ((uint8_t)((path*(PSTEP+1))&(PSTEP-1)))
|
||||||
#define img_get(ptr) (&(pool.chunks[(uint8_t)(ptr-1)>>8]->images[(uint8_t)(ptr-1)&(PSTEP-1)]))
|
#define img_get(ptr) (&(pool.chunks[(uint8_t)((ptr)>>8)]->images[(uint8_t)((ptr)&(PSTEP-1))]))
|
||||||
|
|
||||||
void
|
void
|
||||||
imagepool_init(short max_images)
|
imagepool_init(short max_images)
|
||||||
|
Loading…
Reference in New Issue
Block a user