From c2c26fce51cd0f20719187db5640d8bf3a02bf2b Mon Sep 17 00:00:00 2001 From: Chirag Shilwant Date: Tue, 1 Sep 2026 15:21:27 +0530 Subject: [PATCH] rpmsg: Fix RPMSG_BUF_INDEX macro to use parameter The macro body references 'rp_hdr' instead of using the declared parameter 'rphdr'. This causes the macro to ignore its argument and always reference whatever 'rp_hdr' variable exists in the calling scope. Fix by using the parameter name in the macro body. Fixes: commit b32187e4fb89 ("openamp: change rx/tx buffer hold flag to count") Signed-off-by: Chirag Shilwant --- lib/rpmsg/rpmsg_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rpmsg/rpmsg_virtio.c b/lib/rpmsg/rpmsg_virtio.c index ed3f492..141edb1 100644 --- a/lib/rpmsg/rpmsg_virtio.c +++ b/lib/rpmsg/rpmsg_virtio.c @@ -41,7 +41,7 @@ ((rp_hdr)->reserved -= 1 << RPMSG_BUF_HELD_SHIFT) /* Get the buffer index */ -#define RPMSG_BUF_INDEX(rphdr) \ +#define RPMSG_BUF_INDEX(rp_hdr) \ ((uint16_t)((rp_hdr)->reserved & ~RPMSG_BUF_HELD_MASK)) /**