From patchwork Sat Mar 15 05:02:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: feng.wei8@zte.com.cn X-Patchwork-Id: 14017715 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E6975228; Sat, 15 Mar 2025 05:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742014942; cv=none; b=FJKPdIOHV5wemx8YM00JV4dYZd/WUYQnsFrK/lZji9LbAc6FkVp0XRjQvBDTbeo7F8dz5PT9mlpgbnqP/sjPB/W84rU6JpxinEf85Cvqyn1oQPnJ9KxfTgjzwg0lvRBz9yC5pxEw+5JoxRVeHp2JfqGDr1uLR9UyUbnVB6Z4F2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742014942; c=relaxed/simple; bh=8NPJpn3HyFTnwXahbQuUWleGTas6jrHLNib3zzqWO84=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=lTTtE9QS7Ixd0ezHuyHqUPxScKA6tsalSjkZZfAbdy+j38mGyhvJmWinTyTacFgt89WwOj9X4WB82lUD1fZLzx+p/PG3/udpF9+9VKUvRQhKno4BPlqkxxpCiUDEI8uMNHd/yFmJUUnEWalG4vZBgqXZwoh8w9hBgJx2Vd7gA5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=63.216.63.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4ZF8H55MX5z5B1KQ; Sat, 15 Mar 2025 13:02:09 +0800 (CST) Received: from xaxapp05.zte.com.cn ([10.99.98.109]) by mse-fl2.zte.com.cn with SMTP id 52F520VX032049; Sat, 15 Mar 2025 13:02:00 +0800 (+08) (envelope-from feng.wei8@zte.com.cn) Received: from mapi (xaxapp04[null]) by mapi (Zmail) with MAPI id mid32; Sat, 15 Mar 2025 13:02:01 +0800 (CST) Date: Sat, 15 Mar 2025 13:02:01 +0800 (CST) X-Zmail-TransId: 2afb67d509c9ffffffff99c-1b7dd X-Mailer: Zmail v1.0 Message-ID: <20250315130201758KxKWj6Mb7bgN6SqVrzu94@zte.com.cn> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: Cc: , , , , , , , , Subject: =?utf-8?q?=5BPATCH=5D_dma-buf=3A_Replace_nested_max=28=29_with_sing?= =?utf-8?q?le_max3=28=29?= X-MAIL: mse-fl2.zte.com.cn 52F520VX032049 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 67D509D1.001/4ZF8H55MX5z5B1KQ From: FengWei Use max3() macro instead of nesting max() to simplify the return statement. Signed-off-by: FengWei --- drivers/dma-buf/dma-heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 3cbe87d4a464..96cb9ab5731a 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -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)) {