staging: media: atomisp: Kill OP_std_modadd() macro

The OP_std_modadd() adds no value, kill it and update the users to
perform the necessary operations themselves. No intended functional
changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
Andy Shevchenko 2026-03-02 15:30:40 +01:00 committed by Sakari Ailus
parent 5cb289b539
commit 4d1e8d9ca1
4 changed files with 5 additions and 19 deletions

View File

@ -139,8 +139,6 @@ static inline uint8_t ia_css_circbuf_get_pos_at_offset(
u32 base,
int offset)
{
u8 dest;
OP___assert(cb);
OP___assert(cb->desc);
OP___assert(cb->desc->size > 0);
@ -150,9 +148,7 @@ static inline uint8_t ia_css_circbuf_get_pos_at_offset(
offset += cb->desc->size;
/* step 2: shift and round by the upper limit */
dest = OP_std_modadd(base, offset, cb->desc->size);
return dest;
return (base + offset) % cb->desc->size;
}
/**

View File

@ -47,7 +47,7 @@ static inline bool ia_css_circbuf_desc_is_full(
ia_css_circbuf_desc_t *cb_desc)
{
OP___assert(cb_desc);
return (OP_std_modadd(cb_desc->end, 1, cb_desc->size) == cb_desc->start);
return ((cb_desc->end + 1) % cb_desc->size) == cb_desc->start;
}
/**
@ -78,8 +78,6 @@ static inline uint8_t ia_css_circbuf_desc_get_pos_at_offset(
u32 base,
int offset)
{
u8 dest;
OP___assert(cb_desc);
OP___assert(cb_desc->size > 0);
@ -88,9 +86,7 @@ static inline uint8_t ia_css_circbuf_desc_get_pos_at_offset(
offset += cb_desc->size;
/* step 2: shift and round by the upper limit */
dest = OP_std_modadd(base, offset, cb_desc->size);
return dest;
return (base + offset) % cb_desc->size;
}
/**

View File

@ -14,10 +14,4 @@
#define CEIL_MUL(a, b) (CEIL_DIV(a, b) * (b))
#define CEIL_SHIFT(a, b) (((a) + (1 << (b)) - 1) >> (b))
/*
* For SP and ISP, SDK provides the definition of OP_std_modadd.
* We need it only for host
*/
#define OP_std_modadd(base, offset, size) ((base + offset) % (size))
#endif /* __MATH_SUPPORT_H */

View File

@ -167,7 +167,7 @@ int ia_css_queue_dequeue(ia_css_queue_t *qhandle, uint32_t *item)
*item = cb_elem.val;
cb_desc.start = OP_std_modadd(cb_desc.start, 1, cb_desc.size);
cb_desc.start = (cb_desc.start + 1) % cb_desc.size;
/* c. Store the queue object */
/* Set only fields requiring update with
@ -315,7 +315,7 @@ int ia_css_queue_peek(ia_css_queue_t *qhandle, u32 offset, uint32_t *element)
if (offset > num_elems)
return -EINVAL;
offset = OP_std_modadd(cb_desc.start, offset, cb_desc.size);
offset = (cb_desc.start + offset) % cb_desc.size;
error = ia_css_queue_item_load(qhandle, (uint8_t)offset, &cb_elem);
if (error != 0)
return error;