blob: 8549f359bd0ef9a0323f4bb357f92d420062d586 [file] [log] [blame]
Mark Rutlandace9bad2018-09-04 11:48:25 +01001cat <<EOF
2/**
Mark Rutlandf3e615b2021-07-13 11:52:50 +01003 * arch_${atomic}_dec_and_test - decrement and test
Mark Rutlandace9bad2018-09-04 11:48:25 +01004 * @v: pointer of type ${atomic}_t
5 *
6 * Atomically decrements @v by 1 and
7 * returns true if the result is 0, or false for all other
8 * cases.
9 */
Marco Elver765dcd22019-11-26 15:04:05 +010010static __always_inline bool
Mark Rutlandf3e615b2021-07-13 11:52:50 +010011arch_${atomic}_dec_and_test(${atomic}_t *v)
Mark Rutlandace9bad2018-09-04 11:48:25 +010012{
Mark Rutlandf3e615b2021-07-13 11:52:50 +010013 return arch_${atomic}_dec_return(v) == 0;
Mark Rutlandace9bad2018-09-04 11:48:25 +010014}
15EOF