Staging
v0.8.1
https://github.com/torvalds/linux
Raw File
Tip revision: af42d3466bdc8f39806b26f593604fdc54140bcb authored by Linus Torvalds on 17 November 2019, 22:47:30 UTC
Linux 5.4-rc8
Tip revision: af42d34
inc_not_zero
cat <<EOF
/**
 * ${atomic}_inc_not_zero - increment unless the number is zero
 * @v: pointer of type ${atomic}_t
 *
 * Atomically increments @v by 1, if @v is non-zero.
 * Returns true if the increment was done.
 */
static inline bool
${atomic}_inc_not_zero(${atomic}_t *v)
{
	return ${atomic}_add_unless(v, 1, 0);
}
EOF
back to top