mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dma-buf: Don't use typeof in va_arg
@ 2022-06-10  7:20 Wan Jiabing
  2022-06-10  7:24 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Wan Jiabing @ 2022-06-10  7:20 UTC (permalink / raw)
  To: Sumit Semwal, Christian König, Daniel Vetter, linux-media,
	dri-devel, linaro-mm-sig, linux-kernel
  Cc: Wan Jiabing

Fix following coccicheck warning:
./drivers/dma-buf/st-dma-fence-unwrap.c:75:39-45: ERROR: reference preceded by free on line 70

Use 'struct dma_fence *' instead of 'typeof(*fences)' to avoid this
warning and also fix other 'typeof(*fences)' to make them consistent.

Fixes: 0c5064fa8d5a ("dma-buf: cleanup dma_fence_unwrap selftest v2")
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 drivers/dma-buf/st-dma-fence-unwrap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c
index 4105d5ea8dde..1137a6d90b32 100644
--- a/drivers/dma-buf/st-dma-fence-unwrap.c
+++ b/drivers/dma-buf/st-dma-fence-unwrap.c
@@ -56,7 +56,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...)
 
 	va_start(valist, num_fences);
 	for (i = 0; i < num_fences; ++i)
-		fences[i] = va_arg(valist, typeof(*fences));
+		fences[i] = va_arg(valist, struct dma_fence *);
 	va_end(valist);
 
 	array = dma_fence_array_create(num_fences, fences,
@@ -72,7 +72,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...)
 error_put:
 	va_start(valist, num_fences);
 	for (i = 0; i < num_fences; ++i)
-		dma_fence_put(va_arg(valist, typeof(*fences)));
+		dma_fence_put(va_arg(valist, struct dma_fence *));
 	va_end(valist);
 	return NULL;
 }
-- 
2.36.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-10  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10  7:20 [PATCH] dma-buf: Don't use typeof in va_arg Wan Jiabing
2022-06-10  7:24 ` Christian König
2022-06-10  7:52   ` Jiabing Wan
2022-06-10  8:00     ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®