1ace9bad4SMark Rutlandcat <<EOF 2ace9bad4SMark Rutland/** 3ace9bad4SMark Rutland * ${atomic}_inc_not_zero - increment unless the number is zero 4ace9bad4SMark Rutland * @v: pointer of type ${atomic}_t 5ace9bad4SMark Rutland * 6ace9bad4SMark Rutland * Atomically increments @v by 1, if @v is non-zero. 7ace9bad4SMark Rutland * Returns true if the increment was done. 8ace9bad4SMark Rutland */ 9765dcd20SMarco Elverstatic __always_inline bool 10ace9bad4SMark Rutland${atomic}_inc_not_zero(${atomic}_t *v) 11ace9bad4SMark Rutland{ 12ace9bad4SMark Rutland return ${atomic}_add_unless(v, 1, 0); 13ace9bad4SMark Rutland} 14ace9bad4SMark RutlandEOF 15