Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp512498pxa; Thu, 27 Aug 2020 08:18:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Y+QrlloRC1RXfy5Oo1hADGc0BOVWdAD5gC/CCldyXvSdrMYZWD3C4MZtWdv0GANbfgkU X-Received: by 2002:a50:a0c7:: with SMTP id 65mr19792404edo.375.1598541503761; Thu, 27 Aug 2020 08:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598541503; cv=none; d=google.com; s=arc-20160816; b=oholRDEq0paXkH+0BE76Uq0b2OuYfb58UuBBx4QxRUTuo9o72pTexkOCChhij4em2L 0qtO0JQEsMGLym7rAsgnA0N4P6Js2706gukgmmD46KnmGoMmmDGXYMHflE1AfZfC0Fsz Mx+bctIPsb0YXbe0vNoatWgtSiDGjdZsht19SaSnvnxbmFqrvezJPhuoaw1OAMcZDoPi /gH4agvnD9uVvM6uXN4jRPKkRw954qy52jhJ8FkYOGyJxWkiu9CHCKEpb9aiZrGpSWMQ Vwa78F/VHmcw4o12dElch9LSJaMdFGE+w2wW+j1jOVMY3CJEDpxNyFUxgxet478cEGSF Qliw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Vee510hlaKXEjilUzfAAyKIFzgEM6FJYt8Ol80rJ/4g=; b=rBeDrDoMYwBVrEI8lCOwwuV/oRfjbSzUwVgiJ5ix7tPIdIolFl7lTqpQo6uVx1HzlL XWqvck9Z85SHNAsrhWspR15Z54fusGzbc8v/Keb4JjtS9ReAi2bwx+2fIL9gEcB1uAhs HuW0JLeySBLIu6UmrPoHngK0iUQHR/F1Qr8mmxkWSNe+JgyfXFl3uzgMatN8qpgddmqV 1qpnbk7OxV3/53EvUshuJMbc5nXQgfZt8KJOhv/GuT+zZE6BnrE3eX+E9qTOyq6PNIQx SXy1OvsPirBfFxb5vBs0xnahOP+dN9c2XPJglPZHoP4li7ZHUJLV0EO+3rqbCEc4ZvYq VtHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si1522616ejm.746.2020.08.27.08.17.59; Thu, 27 Aug 2020 08:18:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbgH0PQ7 (ORCPT + 99 others); Thu, 27 Aug 2020 11:16:59 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35622 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbgH0PPw (ORCPT ); Thu, 27 Aug 2020 11:15:52 -0400 Received: by mail-lj1-f193.google.com with SMTP id i10so6884194ljn.2 for ; Thu, 27 Aug 2020 08:15:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vee510hlaKXEjilUzfAAyKIFzgEM6FJYt8Ol80rJ/4g=; b=t/o2WDYxUN0aHwsD9rZ1xk22+koLQmPHqh4SGTMOCytHpSE038ixLdGHHmns8OPjVo R4YnYe7ULRp1tM06XJzPEUn5eogarylJBT1Ejn/I9NHYiH0kk2rP6p78+OZuKW93B5Ts wYt2Rn7H04+eL9aIN2ekS43119uawFtXBqoXYYzyNTiML+DT4MO0JSrElHNxO1Aii+6P B4HAqFE5Gw3qPvdzZt5cMAS07JGi3ZaHwL5raENV+9UuJ2BHNrr0BtxvBTiaQvhd5NRi FtBn8d2XEgm/izwnh3/ITXIlVNr93YQoNC2PV8OSSAsB8LhXuLys9FMnvMxuHATv3Ih5 mwag== X-Gm-Message-State: AOAM533xw4hYSFCavGsylWZzNkhV7crqqX3xQ5UUILG/S13JXYFTFYhw BlsDJHFqDCIMf0iNzjeV1iE= X-Received: by 2002:a2e:918f:: with SMTP id f15mr9729215ljg.86.1598541350578; Thu, 27 Aug 2020 08:15:50 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.111]) by smtp.googlemail.com with ESMTPSA id y9sm532209lji.106.2020.08.27.08.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 08:15:50 -0700 (PDT) From: Denis Efremov To: linux-arm-kernel@lists.infradead.org Cc: Denis Efremov , Andrew Morton , linux-kernel@vger.kernel.org, Russell King Subject: [PATCH] ARM/dma-mapping: use kvzalloc() in __iommu_alloc_buffer() Date: Thu, 27 Aug 2020 18:15:41 +0300 Message-Id: <20200827151541.39662-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kvzalloc() in __iommu_alloc_buffer() instead of open-coding it. Signed-off-by: Denis Efremov --- 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 8a8949174b1c..9def10affa70 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1203,10 +1203,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.26.2