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: 9510443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 735FD601E7 for ; Wed, 11 Jan 2017 15:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F057285AF for ; Wed, 11 Jan 2017 15:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50DCB28620; Wed, 11 Jan 2017 15:23:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8307285AF for ; Wed, 11 Jan 2017 15:23:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRKkC-0007O6-0S; Wed, 11 Jan 2017 15:23:20 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRKjw-0006OT-JZ for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Jan 2017 15:23:04 +0000 Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRKWG-0007Sj-Mu for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2017 15:08:58 +0000 Received: by mail-pf0-x232.google.com with SMTP id y143so42203160pfb.0 for ; Wed, 11 Jan 2017 07:08:35 -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=ZuCjrmK66f6DeqCF/RzV5uRQK8r1rnxzMKjFJqki9aqw+5mtn7pIhfStiEPN3zi34/ xd86XzCfjUkVsskwmLx4vqRXDKxbz8QCeAIUqVoQ7UzrAJfDcBUdgJ91pf3OAXdBMmye 5/NIthgyUQWhPuWHK+F9jTdSsIM1dmXIk5AECTRFg+FfPrk+ByiW4ItM1NjxVqYxYCID L8pVs5hkSArfvlxfVHDAB5j9fo9x0vAgKMPT0htzCVefMjI9isFbq+2nvUrenVuvDSlD PZAjoxktPqDILk3v6Ki0nMLr0/8j1+NoxwuBBTGXMghP3yiVMlUqxT00h1at6McRtFrM XhrA== X-Gm-Message-State: AIkVDXLeTF/r/WZCFb1K/8S9wVDJ+h8/EqVrBmv1ZIg+6LWUvVogpf8oMSMeycnbRXGzJMmW 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_150856_915593_212225AE X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huxinwei@huawei.com, Kefeng Wang , Matthias Brugger , Jon Masters , yimin@huawei.com, Greg KH , linux-kernel@vger.kernel.org, linuxarm@huawei.com, Sinan Kaya , linux-acpi@vger.kernel.org, Xinwei Kong , Hanjun Guo , Tomasz Nowicki , Thomas Gleixner , Agustin Vega-Frias , linux-arm-kernel@lists.infradead.org, Ma Jun MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);