From: Mika Westerberg Date: Mon, 10 Nov 2025 11:18:06 +0000 (+0200) Subject: thunderbolt: Add helper to figure size of the ring X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d614113c10ae6e35e74cdfc4fea280ce1a93ca0b;p=thirdparty%2Fkernel%2Flinux.git thunderbolt: Add helper to figure size of the ring 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 --- diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h index 1160e0bf5c5b7..9df8a356396fd 100644 --- a/include/linux/thunderbolt.h +++ b/include/linux/thunderbolt.h @@ -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,