dma-buf: heaps: use max3() in dma_heap_ioctl
PATCH 1/1 dma-buf: heaps: use max3() in dma_heap_ioctl
Replace two nested max() calls with a single max3() in dma_heap_ioctl().
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/dma-buf/dma-heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/dma-heap.c +1 -1
@@ -153,7 +153,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)) {
T.J. Mercier
reviewerQuoted 13 lines · Thorsten Blum
Replace two nested
max()calls with a singlemax3()indma_heap_ioctl().Signed-off-by Thorsten Blum <[email protected]>--- drivers/dma-buf/dma-heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma-buf/dma-heap.c +0
-0
drivers/dma-buf/dma-heap.c static long dma_heap_ioctl(struct file *file, unsigned int ucmd, · line 156
Quoted 5 lines
drivers/dma-buf/dma-heap.c +1
-1@@ -153,7 +153,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);
Hi,
Could you add #include <linux/minmax.h> as well? It's currently missing.
With that: Reviewed-by: T.J.Mercier <[email protected]>
Thanks,
T.J.