From nobody Sat Feb 7 13:59:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23313C4332F for ; Tue, 12 Dec 2023 03:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345849AbjLLDUy (ORCPT ); Mon, 11 Dec 2023 22:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231238AbjLLDUw (ORCPT ); Mon, 11 Dec 2023 22:20:52 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D384CD for ; Mon, 11 Dec 2023 19:20:57 -0800 (PST) Received: from mxde.zte.com.cn (unknown [10.35.20.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Sq3m368f9zW8l for ; Tue, 12 Dec 2023 11:20:51 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4Sq3lx5jZnz5yGyX for ; Tue, 12 Dec 2023 11:20:45 +0800 (CST) 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 4Sq3lq4nkdz8XrRF; Tue, 12 Dec 2023 11:20:39 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.97.17]) by mse-fl1.zte.com.cn with SMTP id 3BC3KXj1052334; Tue, 12 Dec 2023 11:20:33 +0800 (+08) (envelope-from yang.guang5@zte.com.cn) Received: from mapi (xaxapp03[null]) by mapi (Zmail) with MAPI id mid31; Tue, 12 Dec 2023 11:20:34 +0800 (CST) Date: Tue, 12 Dec 2023 11:20:34 +0800 (CST) X-Zmail-TransId: 2afb6577d182ffffffff9f1-650fe X-Mailer: Zmail v1.0 Message-ID: <202312121120348064534@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIEFSTS9kbWEtbWFwcGluZzogcmVwbGFjZSBremFsbG9jKCkgYW5kIHZ6YWxsb2MoKSB3aXRoIGt2emFsbG9jKCk=?= X-MAIL: mse-fl1.zte.com.cn 3BC3KXj1052334 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6577D192.001/4Sq3m368f9zW8l Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yang Guang using kvzalloc() simplifies the code by avoiding the=20 use of different memory allocation functions for different=20 situations, making the code more uniform and readable. Signed-off-by: Chen Haonan Reviewed-by: Linus Walleij --- arch/arm/mm/dma-mapping.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 5409225b4abc..d688eac6dbc1 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -859,10 +859,7 @@ static struct page **__iommu_alloc_buffer(struct devic= e *dev, size_t size, int i =3D 0; int order_idx =3D 0; - if (array_size <=3D PAGE_SIZE) - pages =3D kzalloc(array_size, GFP_KERNEL); - else - pages =3D vzalloc(array_size); + pages =3D kvzalloc(array_size, GFP_KERNEL); if (!pages) return NULL; --=20 2.25.1