summaryrefslogtreecommitdiff
path: root/include/linux/ptr_ring.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-08-14 10:17:11 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-08-14 10:17:11 +0900
commitacbecf60145a2d6259ff3e059fd295cf626ed574 (patch)
tree3b21eceaed0fc860b7070b099d3bd1d62cef2288 /include/linux/ptr_ring.h
parent5d5fd841c34649f1b09220fe58e59dffd61c447d (diff)
parentdb2ddb87143519e20a95aa36c60b36107b736a58 (diff)
Merge 7.2-rc7 into usb-next
We need the USB fixes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/ptr_ring.h')
-rw-r--r--include/linux/ptr_ring.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index c95e891903f0..d2c3629bbe45 100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -98,29 +98,13 @@ static inline bool ptr_ring_full_bh(struct ptr_ring *r)
/* Note: callers invoking this in a loop must use a compiler barrier,
* for example cpu_relax(). Callers must hold producer_lock.
- */
-static inline int __ptr_ring_check_produce(struct ptr_ring *r)
-{
- if (unlikely(!r->size))
- return -EINVAL;
-
- if (data_race(r->queue[r->producer]))
- return -ENOSPC;
-
- return 0;
-}
-
-/* Note: callers invoking this in a loop must use a compiler barrier,
- * for example cpu_relax(). Callers must hold producer_lock.
* Callers are responsible for making sure pointer that is being queued
* points to a valid data.
*/
static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr)
{
- int p = __ptr_ring_check_produce(r);
-
- if (p)
- return p;
+ if (unlikely(!r->size) || data_race(r->queue[r->producer]))
+ return -ENOSPC;
/* Make sure the pointer we are storing points to a valid data. */
/* Pairs with the dependency ordering in __ptr_ring_consume. */