Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4393084rdb; Mon, 11 Dec 2023 19:21:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+TTKv9nrSi3n/GYHj0EmwM2uz+CjGWdbTsEJzlGV6ZAGeA+BYvEKbhVRhiNFm6Sd4i/0+ X-Received: by 2002:a05:6808:13d3:b0:3b9:db46:8ede with SMTP id d19-20020a05680813d300b003b9db468edemr7989244oiw.21.1702351263775; Mon, 11 Dec 2023 19:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702351263; cv=none; d=google.com; s=arc-20160816; b=qK97Jjow0YST4InRNGQ4m8kSvs3cUP1kNvuVpvrlhcx/Zps7Xk6xtXC4lZaIycyS+1 wdj1UgFbhMIbnCBT3fKDQjQc5wOMRdLbrOja6bAB7+UJ6tNdu0uDud6hPomPQStW6AnX 3fCKOg/gxv+HmZAaXFO3JCumciiW4KaTx9QCeQjSxeg8Fv1qoWANl94XuGs/+YSOZ/BD zQXl4pdJD4eeE7ItTjUWlbKnPOp3zHUykSdewVWyZZOF2278E+rheBTkfGxLCVVw0iw7 /32DSvI9pGgglBRCxM1e1/WcQiyXw8rW1NYkwBLW+USTyt8r6kRTFBQtE5xmtqOre+Eq f2cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=eK/3yI5X8YZF3bs85A7gdpA8ex79GAZAP/K6huJMwNU=; fh=hQ99+M+cQxFzOiP5tbqm3qDzxss5ZELofJJ7pfUlCLs=; b=lv2GBD9XzbLd4/2RRCZxvpeHarjiMCjD37fCJk+onVm8+AUZmCsubYMtzKVgKsk6sH IORRA7LnX78itNdmA+RrtmuEE2ja/u6WF8gDNeklgdwDQn6RMNJKW3svZyZyjrxqQN8Y 0FMbeTAGT+fxKucELbiwva5t8jHmUm4SQfvn8d24VWsOWN94cde0GzW6XmYeG/hxFO0H uIM5VX/rgEFAs09WdxRZYqAceZdfxjkl4/qA9dd7+/FzLvoZecpXrBZ/YqVfkMcGMPNo 6AKYRJul75CKtflVAFPlP1JYWYrpuVaHYXZSyvFzawNlHDu2U8oD/IaHUPLCPOtZsLyJ BgZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z5-20020aa78885000000b006cb4d47cfa9si6975544pfe.270.2023.12.11.19.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 19:21:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B6313804E73C; Mon, 11 Dec 2023 19:21:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345801AbjLLDUx (ORCPT + 99 others); Mon, 11 Dec 2023 22:20:53 -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=?= Content-Type: text/plain; charset="UTF-8" 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 19:21:02 -0800 (PST) From: Yang Guang using kvzalloc() simplifies the code by avoiding the use of different memory allocation functions for different situations, making the code more uniform and readable. Signed-off-by: Chen Haonan --- 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 device *dev, size_t size, int i = 0; int order_idx = 0; - if (array_size <= PAGE_SIZE) - pages = kzalloc(array_size, GFP_KERNEL); - else - pages = vzalloc(array_size); + pages = kvzalloc(array_size, GFP_KERNEL); if (!pages) return NULL; -- 2.25.1