Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4186792ybl; Mon, 9 Dec 2019 06:51:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzrmg7yKSckyv109X6FD5xxAxC33JOka3WET3dtjpjPt/tk561BUbSA0Nirwaq4dF/+Or+h X-Received: by 2002:a9d:6c8:: with SMTP id 66mr21561096otx.271.1575903102872; Mon, 09 Dec 2019 06:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575903102; cv=none; d=google.com; s=arc-20160816; b=vms4nduW4FZSpsp0meJnEVcGTKPdj7KfXrjyeAHNoeNswcPEaCzoz6JW6GJeLSYKxR hDrD4aRxnqad4dHLzKS9AJ5x44/8/AjZ6ldd1F5YNZOfwJvGTKzxKmgV0EHlDoZMev2y XF4a94LAkjJvcojv5M4R6qOsbxMKiNnVt3dmCumdiuemHiJEmljotiCuwfjf5qnNCV9o 6AROkd1bi1CzJEuUmW5HW7w1+l4c3Uk+/VkeQ0JO1ZXzTJS1KShsnS5xYeUSU6bnucOf WZCkxxqoqKfcG9aSBYBOp4cngmd4mOzYgy/yXxIoodkB+kY+8AQf3iV8h4pynabWxfHu eTbg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=li3aL6AKer4CD9SxvytTfEJufU4SX6U6gX8As2O4Eqk=; b=PNjW/nqypVsP21f2Y0QpGVqeutNccxzLU2Yx3NewuG6pTONvzJ8kLHTmRfCEGvrBt4 SykGKrNBwBV5Djefi6Q76FvY9NQpCXQtz0Xi9CADqWeBhRYHLpvQZXY4u5WHVmImx2zQ 7R0eaDdeX9VIXQK5VmFgCi//qTiPMtavgTBvTlm0dHk0t/vTWnKO+r/eWsRneGv5TzIH HoijhuEd3eNnu36bzAw1bNZx+wXr0WpGElaQdl7b1cZ3oNJYy8EmiZVC2OvuJZ+hkZtz 7Yo1ZZ3maeR0IKAh5u45w4sljFFreneKZ2x09No6MgYfaaD4Jsf+5L4dLZ7E3bDflDsk zMMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sIbbmsAK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y198si12440022oia.163.2019.12.09.06.51.31; Mon, 09 Dec 2019 06:51:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sIbbmsAK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726598AbfLIOuT (ORCPT + 99 others); Mon, 9 Dec 2019 09:50:19 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34070 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbfLIOuS (ORCPT ); Mon, 9 Dec 2019 09:50:18 -0500 Received: by mail-wr1-f66.google.com with SMTP id t2so16562128wrr.1 for ; Mon, 09 Dec 2019 06:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=li3aL6AKer4CD9SxvytTfEJufU4SX6U6gX8As2O4Eqk=; b=sIbbmsAKQOinyqrXzcC99G76KdGrMEBizkBgPtvaRxn8ZKhsfY5X977UavqreA+/rf 6IRczi+ABL0XqlQHMKt9eOe/MtYJQ8CvDjSThFwoQD3J3AyC56sPJTUrEaZLgLEja96e dK3bdVprHh6nx24uLGY2MnQvm+2b2lI+H6jfYdfzuO/LR6dBLTl/wDDhsIg6/WLdtBs3 yqlMPfNu6+7i4kwgT6zFfxpN42GOZF6RWrvZRmmMr9cC0Y8YBjMEUsyaLLL56p2ZicIE B5eHoYivdlm1CdYuboV2OPBvt7Kjl4Ce5zeh2hZgXUTSES5/2vzXNFrlcSxEi9+doRrC Gk0Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=li3aL6AKer4CD9SxvytTfEJufU4SX6U6gX8As2O4Eqk=; b=Lx9BoisndePlINsBzMNssglpzQigwDQGb9PD+4EE0LJD+suTS47c7DhAAIzEgmsftJ z91JP1c61zq1TFFGg4Yhrck3pWLAFHVG7GT0cc5a6oQxZBA1Thi//t84RZ/I+giMpRZ1 rOLo6IAozlsz2Atmow/N8TjGFuGT0V3qv3LcjNLL/LLGhs8hdb3hMMt3LuVo+ytklHFH ZkR+RHm4+GdxmZ4PQMF3ckqhHXN2HmF8dGypDdaXY6P+zyYg9Mx/mC2QtnGecTwnBZds 4uEOYCUtfXwW4qlZRj2B2wlTYmF3zubDCUeQgf/w4nygwccpMckHO9n5lKrpAvJnu61k UTvQ== X-Gm-Message-State: APjAAAWtOy0xfECDtg6hDC2bshPYWT2PEEothoheox/qC/r+b9KLVSAO MK40m/JIiuMHKugSYgSU/r0= X-Received: by 2002:a5d:6ac5:: with SMTP id u5mr2572334wrw.271.1575903016835; Mon, 09 Dec 2019 06:50:16 -0800 (PST) Received: from localhost (pD9E518ED.dip0.t-ipconnect.de. [217.229.24.237]) by smtp.gmail.com with ESMTPSA id d186sm8590wmf.7.2019.12.09.06.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 06:50:15 -0800 (PST) From: Thierry Reding To: Joerg Roedel Cc: Will Deacon , Robin Murphy , David Woodhouse , Jean-Philippe Brucker , Christoph Hellwig , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] iommu: amd: Use iommu_put_resv_regions_simple() Date: Mon, 9 Dec 2019 15:50:05 +0100 Message-Id: <20191209145007.2433144-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191209145007.2433144-1-thierry.reding@gmail.com> References: <20191209145007.2433144-1-thierry.reding@gmail.com> 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 From: Thierry Reding Use the new standard function instead of open-coding it. Signed-off-by: Thierry Reding --- drivers/iommu/amd_iommu.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index bd25674ee4db..5896cbe6106b 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2641,15 +2641,6 @@ static void amd_iommu_get_resv_regions(struct device *dev, list_add_tail(®ion->list, head); } -static void amd_iommu_put_resv_regions(struct device *dev, - struct list_head *head) -{ - struct iommu_resv_region *entry, *next; - - list_for_each_entry_safe(entry, next, head, list) - kfree(entry); -} - static bool amd_iommu_is_attach_deferred(struct iommu_domain *domain, struct device *dev) { @@ -2688,7 +2679,7 @@ const struct iommu_ops amd_iommu_ops = { .device_group = amd_iommu_device_group, .domain_get_attr = amd_iommu_domain_get_attr, .get_resv_regions = amd_iommu_get_resv_regions, - .put_resv_regions = amd_iommu_put_resv_regions, + .put_resv_regions = iommu_put_resv_regions_simple, .is_attach_deferred = amd_iommu_is_attach_deferred, .pgsize_bitmap = AMD_IOMMU_PGSIZES, .flush_iotlb_all = amd_iommu_flush_iotlb_all, -- 2.23.0