Merge tag 'pci-v6.16-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
[linux-block.git] / scripts / atomic / fallbacks / dec_if_positive
CommitLineData
ace9bad4 1cat <<EOF
9257959a 2 ${int} dec, c = raw_${atomic}_read(v);
ace9bad4
MR
3
4 do {
5 dec = c - 1;
6 if (unlikely(dec < 0))
7 break;
9257959a 8 } while (!raw_${atomic}_try_cmpxchg(v, &c, dec));
ace9bad4
MR
9
10 return dec;
ace9bad4 11EOF