]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
thunderbolt: Add helper to figure size of the ring
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 10 Nov 2025 11:18:06 +0000 (13:18 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 19 May 2026 12:20:18 +0000 (14:20 +0200)
Add to common header a function that returns size of the ring. This can
be used in the drivers instead of rolling own version.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
include/linux/thunderbolt.h

index 1160e0bf5c5b7828d14baf6bafffbf71ba7dda79..9df8a356396fd77cb52fb5f86b1d402358b63383 100644 (file)
@@ -641,6 +641,11 @@ static inline size_t tb_ring_frame_size(const struct ring_frame *frame)
        return TB_MAX_FRAME_SIZE;
 }
 
+static inline size_t tb_ring_size(const struct tb_ring *ring)
+{
+       return ring->size;
+}
+
 struct tb_ring *tb_ring_alloc_tx(struct tb_nhi *nhi, int hop, int size,
                                 unsigned int flags);
 struct tb_ring *tb_ring_alloc_rx(struct tb_nhi *nhi, int hop, int size,