Skip to contentSkip to conversation

dma-buf: Use max3() instead of nested max()

PATCH New Qasim Ijaz 1 participant 1 message Feb 25, 2025

Subsystems (3)
lore
Share & tools
lore

Qasim Ijaz

author
#0 lore raw

PATCH 1/1 dma-buf: Use max3() instead of nested max()

Use the well-known max3() macro instead of nesting max() to find the maximum between in_size, out_size and drv_size.

---
 drivers/dma-buf/dma-heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/dma-heap.c +1 -1
index 3cbe87d4a464..96cb9ab5731a 100644
@@ -147,7 +147,7 @@ static long dma_heap_ioctl(struct file *file, unsigned int ucmd,
 		in_size = 0;
 	if ((ucmd & kcmd & IOC_OUT) == 0)
 		out_size = 0;
-	ksize = max(max(in_size, out_size), drv_size);
+	ksize = max3(in_size, out_size, drv_size);
 
 	/* If necessary, allocate buffer for ioctl argument */
 	if (ksize > sizeof(stack_kdata)) {
Signature · 1 line
2.39.5