Commit | Line | Data |
---|---|---|
ace9bad4 MR |
1 | cat <<EOF |
2 | /** | |
f3e615b4 | 3 | * arch_${atomic}_inc_not_zero - increment unless the number is zero |
ace9bad4 MR |
4 | * @v: pointer of type ${atomic}_t |
5 | * | |
6 | * Atomically increments @v by 1, if @v is non-zero. | |
7 | * Returns true if the increment was done. | |
8 | */ | |
765dcd20 | 9 | static __always_inline bool |
f3e615b4 | 10 | arch_${atomic}_inc_not_zero(${atomic}_t *v) |
ace9bad4 | 11 | { |
f3e615b4 | 12 | return arch_${atomic}_add_unless(v, 1, 0); |
ace9bad4 MR |
13 | } |
14 | EOF |