Merge tag 'mlx5-updates-2023-03-20' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / scripts / atomic / fallbacks / add_negative
CommitLineData
ace9bad4
MR
1cat <<EOF
2/**
e5ab9eff 3 * arch_${atomic}_add_negative${order} - Add and test if negative
ace9bad4
MR
4 * @i: integer value to add
5 * @v: pointer of type ${atomic}_t
6 *
e5ab9eff
TG
7 * Atomically adds @i to @v and returns true if the result is negative,
8 * or false when the result is greater than or equal to zero.
ace9bad4 9 */
765dcd20 10static __always_inline bool
e5ab9eff 11arch_${atomic}_add_negative${order}(${int} i, ${atomic}_t *v)
ace9bad4 12{
e5ab9eff 13 return arch_${atomic}_add_return${order}(i, v) < 0;
ace9bad4
MR
14}
15EOF