From patchwork Thu Aug 27 15:15:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis Efremov (Oracle)" X-Patchwork-Id: 11740903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80325739 for ; Thu, 27 Aug 2020 15:16:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5959F2087D for ; Thu, 27 Aug 2020 15:16:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DYFwTq/h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5959F2087D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gRutzZp93u6I9Ox1foNC7zE5bKT3yrCMCkz0KVT47IQ=; b=DYFwTq/hxmKZJLyhehBOUqhTXM 6w9Wsc/Eh6SI9ZEMYXYdpTujc91x1fAiq48PqwW801ixdO8Qz23YE7mfMQRQBuTV6SnsTBk656Mx3 O1MWOxKRY5dUIma5tHFaejzswyFVTNgoxydesXEnAlvRJQMn1KHL4RoClJzabngeDswPQaDZvflWW jRBCwaJDxbEjQ4V/eT5oI/pmb6L5uxNUROn0LBlwcmUeVGD2NQ1PmvVjq2r052I3OnyKKXilrHeiz fre0BDXzvuZPmg8na/JR/+8/BzFTnoFnBh/ucHGH4Xg4uwnm9WiHvygJlqL1TFIifpbxCQ3cCTJs6 Nx2Y8WFw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBJd7-0003QM-LX; Thu, 27 Aug 2020 15:15:57 +0000 Received: from mail-lj1-f196.google.com ([209.85.208.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBJd4-0003P8-Jq for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 15:15:55 +0000 Received: by mail-lj1-f196.google.com with SMTP id w14so6870378ljj.4 for ; Thu, 27 Aug 2020 08:15:52 -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=Jjgf/ECWfXXY13fDWyh2yjDV/xYyUrQ9QvI7mW9u5bbNIkjabvvDkVESORL2QP9xyj j04qYr1eobbVXIVl6o42gNpgbmuDJhdEcRYOgDUW6DfawSnqd0UF5Dt8cRuJ5qjGEnhH A0EOdUl972KUsjFHCXH4T9ZCRThpPqUGcB3WRT8G8AlIXsWdWEd7w8AeL3R/pVSx825x 4aSIXlmPcgOTT+Ymfkfe9UBcOZ/nAYNMo1EfriRg8kctYYrOmVUb9WLB/XiexHtqEy+a 27ZEXkh8JgGmydoydTDafvxzjRu0tS3xMx5TVg7u3Er/R2N3JtgUN5RICld2VogRM/Bm fzoA== X-Gm-Message-State: AOAM5339jBfxrz7ejHxj78UZTLLkc97Cqd0B6/NZ+Hk5NQi/WS6u4naA GP0VaPovuNhLVG4XfPZqzLYrPfvLzQc= X-Google-Smtp-Source: ABdhPJwXlSIz+YWou16eoxNonKiNs689uN3pfPogY0WqVFeBhVt5XbmYDxq34O0s8zLwVcqzGrEzCA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_111554_664171_57637D1E X-CRM114-Status: GOOD ( 12.63 ) X-Spam-Score: 0.5 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.196 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.196 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yefremov.denis[at]gmail.com] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Morton , linux-kernel@vger.kernel.org, Denis Efremov , Russell King Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;