From patchwork Sat Mar 15 04:40:09 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: 14017714 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) (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 22D5D367; Sat, 15 Mar 2025 04:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.40 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742013623; cv=none; b=I1H2mw4g29KaWoT5vV9k4hUjuh7zGweyyGgKZfoXcFqbZIkob1di469G2NxFdZFE75buYlNxd+T6tyhLB5tQ+EDL3g9NJubEVwHd1I3dM0r9BcG8tATb0rjHw71yYPayD1HwD6tQL/X6Kov85ci4ed371MhKox53sfUEXuvqms8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742013623; c=relaxed/simple; bh=8NPJpn3HyFTnwXahbQuUWleGTas6jrHLNib3zzqWO84=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=KEjEHFKJbUFLl9lz1aKTQ6pHToiwxACQ2TYg5OjfKeN3l6T2XvHQLB3YSGUhInKEOGaW+cczWAo5TJ1T6XMoF5EjgbZfAJby47mjJfhXKiP5vhwU8ZxDf+4eIXXpOxYpRIf/OPW3DAEVJZZRVlvdIq/7nLBKlfNR7RPzFuwzObg= 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.40 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-fl1.zte.com.cn (unknown [10.5.228.132]) (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 4ZF7nn4yXYz8R039; Sat, 15 Mar 2025 12:40:13 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 52F4e95m076816; Sat, 15 Mar 2025 12:40:09 +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 12:40:09 +0800 (CST) Date: Sat, 15 Mar 2025 12:40:09 +0800 (CST) X-Zmail-TransId: 2afb67d504a97f3-07648 X-Mailer: Zmail v1.0 Message-ID: <20250315124009404aGYiofkCnWFti1fQoFZ58@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_Replace_nested_max=28=29_with_single_max3=28?= =?utf-8?q?=29?= X-MAIL: mse-fl1.zte.com.cn 52F4e95m076816 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 67D504AD.001/4ZF7nn4yXYz8R039 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)) {