From patchwork Wed Jan 11 15:06:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 90909 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1166314qgi; Wed, 11 Jan 2017 07:08:44 -0800 (PST) X-Received: by 10.99.139.76 with SMTP id j73mr11436026pge.23.1484147324363; Wed, 11 Jan 2017 07:08:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a184si6049863pgc.229.2017.01.11.07.08.44; Wed, 11 Jan 2017 07:08:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760906AbdAKPIf (ORCPT + 7 others); Wed, 11 Jan 2017 10:08:35 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33073 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764580AbdAKPIe (ORCPT ); Wed, 11 Jan 2017 10:08:34 -0500 Received: by mail-pf0-f180.google.com with SMTP id y143so42203159pfb.0 for ; Wed, 11 Jan 2017 07:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FIcOEcLE9OIXaZlsgqZKnHb3suBu5PJnVYqkD/4fBBo=; b=YXzNhyVz5s1UmjYn1of6G7/mwNAaNs2NtFDb1qeA5T30EhHd/l0XgwituEjXYM3Tkl uEG2hetjM7U7ZiTP+N9jSltkmG+Tu3bluGXfgKw/ZjZMrvduSTDqWkFWgeN+Ljnh0j1m +Q0z+NoJhpVO4GBNhfbiJkT3vtPg6RYYxKpV4= 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; bh=FIcOEcLE9OIXaZlsgqZKnHb3suBu5PJnVYqkD/4fBBo=; b=f5LhMH47rjszKTnm2afel85ElRmknctumwAm5OMioJ4gurki7BXbKNXsEpvVMyxDJS 5wj/NC0FAyNz3cetfw4OevvmfLLaS/xVHPV2L/ZwW+YMcWVy4Xn73yG8D2J5KRZ7Htu5 5+lF5Aer6ORdLFi60L/zPDfnARY0vQcWoJtBfqcf8wu6wJt0c9igb/hKn22VImfl20tz 1XxyilZ+KPQEoBn4FC7dIzHIRc6gKgdWPL1u6Xhne8fAD7AZ42BIZjLJygtvaSlsbe1R VKiB6vmPLCHTauHfAir8Q1qVsLojVRX0vI3QELN5UTAMb5YjJu0lHKct4KaUFYJW1EYV KHfA== X-Gm-Message-State: AIkVDXKF0VVoPRb2F7WVz0Fez7FCrwtBSKpcCEhdgnjHSGqfsLMjnXichxBE/ercQ4b6qfxH X-Received: by 10.98.194.130 with SMTP id w2mr10718108pfk.143.1484147314207; Wed, 11 Jan 2017 07:08:34 -0800 (PST) Received: from localhost ([104.237.91.103]) by smtp.googlemail.com with ESMTPSA id 64sm4569202pfz.48.2017.01.11.07.08.32 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 11 Jan 2017 07:08:33 -0800 (PST) From: Hanjun Guo To: Marc Zyngier , "Rafael J. Wysocki" , Lorenzo Pieralisi Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, Thomas Gleixner , Greg KH , Tomasz Nowicki , Ma Jun , Kefeng Wang , Agustin Vega-Frias , Sinan Kaya , huxinwei@huawei.com, yimin@huawei.com, Jon Masters , Matthias Brugger , Xinwei Kong , Hanjun Guo Subject: [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make it generic Date: Wed, 11 Jan 2017 23:06:32 +0800 Message-Id: <1484147199-4267-9-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484147199-4267-1-git-send-email-hanjun.guo@linaro.org> References: <1484147199-4267-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org iort_node_map_rid() was designed for both PCI and platform device, but the rid means requester id is for ITS mappings, rename iort_node_map_rid() to iort_node_map_id() and update its argument names to make it more generic. Signed-off-by: Hanjun Guo Cc: Lorenzo Pieralisi Cc: Tomasz Nowicki --- drivers/acpi/arm64/iort.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 208eac9..069a690 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -355,11 +355,11 @@ struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node, return NULL; } -static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node, - u32 rid_in, u32 *rid_out, - u8 type_mask) +static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node, + u32 id_in, u32 *id_out, + u8 type_mask) { - u32 rid = rid_in; + u32 id = id_in; /* Parse the ID mapping tree to find specified node type */ while (node) { @@ -367,8 +367,8 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node, int i; if (IORT_TYPE_MASK(node->type) & type_mask) { - if (rid_out) - *rid_out = rid; + if (id_out) + *id_out = id; return node; } @@ -385,9 +385,9 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node, goto fail_map; } - /* Do the RID translation */ + /* Do the ID translation */ for (i = 0; i < node->mapping_count; i++, map++) { - if (!iort_id_map(map, node->type, rid, &rid)) + if (!iort_id_map(map, node->type, id, &id)) break; } @@ -399,9 +399,9 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node, } fail_map: - /* Map input RID to output RID unchanged on mapping failure*/ - if (rid_out) - *rid_out = rid_in; + /* Map input ID to output ID unchanged on mapping failure */ + if (id_out) + *id_out = id_in; return NULL; } @@ -439,7 +439,7 @@ u32 iort_msi_map_rid(struct device *dev, u32 req_id) if (!node) return req_id; - iort_node_map_rid(node, req_id, &dev_id, IORT_MSI_TYPE); + iort_node_map_id(node, req_id, &dev_id, IORT_MSI_TYPE); return dev_id; } @@ -462,7 +462,7 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id, if (!node) return -ENXIO; - node = iort_node_map_rid(node, req_id, NULL, IORT_MSI_TYPE); + node = iort_node_map_id(node, req_id, NULL, IORT_MSI_TYPE); if (!node) return -ENXIO; @@ -591,8 +591,8 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) if (!node) return NULL; - parent = iort_node_map_rid(node, rid, &streamid, - IORT_IOMMU_TYPE); + parent = iort_node_map_id(node, rid, &streamid, + IORT_IOMMU_TYPE); ops = iort_iommu_xlate(dev, parent, streamid);