media: atomisp: Kill OP_std_modadd() macro
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- .../atomisp/pci/base/circbuf/interface/ia_css_circbuf.h | 6 +----- .../pci/base/circbuf/interface/ia_css_circbuf_desc.h | 8 ++------ .../media/atomisp/pci/hive_isp_css_include/math_support.h | 6 ------ .../staging/media/atomisp/pci/runtime/queue/src/queue.c | 4 ++-- 4 files changed, 5 insertions(+), 19 deletions(-)
drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf.h +1 -5
@@ -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 );
@@ -151,9 +149,7 @@ static inline uint8_t ia_css_circbuf_get_pos_at_offset( }/* 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; }/**
drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf_desc.h +2 -6
@@ -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 );
@@ -89,9 +87,7 @@ static inline uint8_t ia_css_circbuf_desc_get_pos_at_offset( }/* 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; }/**
drivers/staging/media/atomisp/pci/hive_isp_css_include/math_support.h +0 -6
@@ -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 */
drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c +2 -2
@@ -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;
Signature · 1 line
2.50.1
Quoted 6 lines · Andy Shevchenko
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 <[email protected]>---
LGTM.
Reviewed-by Ethan Tidmore <[email protected]>
Thanks,
ET