blob: 15caa2eb237128a3f1bcad00694c0e1ada8b0b00 [file] [log] [blame]
Mark Rutlandace9bad2018-09-04 11:48:25 +01001cat <<EOF
2/**
Mark Rutlandf3e615b2021-07-13 11:52:50 +01003 * arch_${atomic}_add_negative - add and test if negative
Mark Rutlandace9bad2018-09-04 11:48:25 +01004 * @i: integer value to add
5 * @v: pointer of type ${atomic}_t
6 *
7 * Atomically adds @i to @v and returns true
8 * if the result is negative, or false when
9 * result is greater than or equal to zero.
10 */
Marco Elver765dcd22019-11-26 15:04:05 +010011static __always_inline bool
Mark Rutlandf3e615b2021-07-13 11:52:50 +010012arch_${atomic}_add_negative(${int} i, ${atomic}_t *v)
Mark Rutlandace9bad2018-09-04 11:48:25 +010013{
Mark Rutlandf3e615b2021-07-13 11:52:50 +010014 return arch_${atomic}_add_return(i, v) < 0;
Mark Rutlandace9bad2018-09-04 11:48:25 +010015}
16EOF