From patchwork Wed Apr 1 16:21:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46639 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83BB2216D1 for ; Wed, 1 Apr 2015 16:35:51 +0000 (UTC) Received: by wgua4 with SMTP id a4sf11380095wgu.2 for ; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=H3wY2JzkullrOK4nLhkBST0VAuD11dI8vLxju1lBnb0=; b=Y/jOBmViGnwZoyGl5pw1RIvFd32I2SGCkxDzyfSadXpoKvyoaGi5RVeBfNmKdGIG1K 6ZTfk4ZrPhiETnqglPUhZoYObsBGmNXaHi1fdXzPP9uMv50NCR4WeNyaotuEpn9s4vCo GewLVVl8dOqKg7mmComzzgZkpuijUtfRaJlFsaiWJSMjBnrRKLx8QR6D/1nX8n4ZFq6h oW9r4XDVEcymfMm9+8E24Te2NnyekeLRBhWDFSZrRygoL8jKgxlWMFXY7PFA6VkUnkmt Eo7ddgT3pDSXBNwXRNQ9u0+hJ4IGl7Pzy9ucJWT2SK62RmzsL1EH8prQdswwKiLxWyOR 5PMw== X-Gm-Message-State: ALoCoQm73YoY0WF+RXNU8lin4NZKCavlm20wQ+hxYoyLRnKLSMK57AmQ5SFs6XwwRMtTrLjcvkaz X-Received: by 10.180.150.115 with SMTP id uh19mr2105328wib.7.1427906150802; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.200 with SMTP id d8ls92219laa.34.gmail; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) X-Received: by 10.112.167.228 with SMTP id zr4mr5425200lbb.113.1427906150682; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id ti8si2006356lbb.149.2015.04.01.09.35.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 09:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lboc7 with SMTP id c7so40484142lbo.1 for ; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) X-Received: by 10.152.5.72 with SMTP id q8mr19078367laq.73.1427906150228; Wed, 01 Apr 2015 09:35:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp777566lbq; Wed, 1 Apr 2015 09:35:49 -0700 (PDT) X-Received: by 10.52.79.98 with SMTP id i2mr23090879vdx.30.1427906148342; Wed, 01 Apr 2015 09:35:48 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id br7si1644636vdd.91.2015.04.01.09.35.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 09:35:48 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YdLao-0007QJ-JW; Wed, 01 Apr 2015 16:34:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YdLan-0007Pk-AO for xen-devel@lists.xenproject.org; Wed, 01 Apr 2015 16:34:13 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 6D/F8-29354-40E1C155; Wed, 01 Apr 2015 16:34:12 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1427906048!13294816!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23825 invoked from network); 1 Apr 2015 16:34:11 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 1 Apr 2015 16:34:11 -0000 X-IronPort-AV: E=Sophos;i="5.11,504,1422921600"; d="scan'208";a="248610207" From: Julien Grall To: Date: Wed, 1 Apr 2015 17:21:36 +0100 Message-ID: <1427905307-23749-4-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427905307-23749-1-git-send-email-julien.grall@citrix.com> References: <1427905307-23749-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v5 p1 03/14] xen/dts: Use unsigned int for MMIO and IRQ index X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Julien Grall There is no reason to use signed integer for an index. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini Acked-by: Ian Campbell --- Changes in v4: - Add Ian's ack Changes in v3: - Slightly update commit message to drop the reference to new hypercalls. - Add Stefano's acked Changes in v2: - Use unsigned int instead fancy one like unsigned or uint32_t --- xen/common/device_tree.c | 11 ++++++----- xen/include/xen/device_tree.h | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 26fa298..25880e8 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -496,7 +496,7 @@ static const struct dt_bus *dt_match_bus(const struct dt_device_node *np) } static const __be32 *dt_get_address(const struct dt_device_node *dev, - int index, u64 *size, + unsigned int index, u64 *size, unsigned int *flags) { const __be32 *prop; @@ -683,7 +683,7 @@ bail: } /* dt_device_address - Translate device tree address and return it */ -int dt_device_get_address(const struct dt_device_node *dev, int index, +int dt_device_get_address(const struct dt_device_node *dev, unsigned int index, u64 *addr, u64 *size) { const __be32 *addrp; @@ -1006,7 +1006,8 @@ fail: return -EINVAL; } -int dt_device_get_raw_irq(const struct dt_device_node *device, int index, +int dt_device_get_raw_irq(const struct dt_device_node *device, + unsigned int index, struct dt_raw_irq *out_irq) { const struct dt_device_node *p; @@ -1014,7 +1015,7 @@ int dt_device_get_raw_irq(const struct dt_device_node *device, int index, u32 intsize, intlen; int res = -EINVAL; - dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%d\n", + dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n", device->full_name, index); /* Get the interrupts property */ @@ -1071,7 +1072,7 @@ int dt_irq_translate(const struct dt_raw_irq *raw, &out_irq->irq, &out_irq->type); } -int dt_device_get_irq(const struct dt_device_node *device, int index, +int dt_device_get_irq(const struct dt_device_node *device, unsigned int index, struct dt_irq *out_irq) { struct dt_raw_irq raw; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index c8a0375..6bbee6d 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -474,7 +474,7 @@ const struct dt_device_node *dt_get_parent(const struct dt_device_node *node); * This function resolves an address, walking the tree, for a give * device-tree node. It returns 0 on success. */ -int dt_device_get_address(const struct dt_device_node *dev, int index, +int dt_device_get_address(const struct dt_device_node *dev, unsigned int index, u64 *addr, u64 *size); /** @@ -504,7 +504,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device); * This function resolves an interrupt, walking the tree, for a given * device-tree node. It's the high level pendant to dt_device_get_raw_irq(). */ -int dt_device_get_irq(const struct dt_device_node *device, int index, +int dt_device_get_irq(const struct dt_device_node *device, unsigned int index, struct dt_irq *irq); /** @@ -516,7 +516,8 @@ int dt_device_get_irq(const struct dt_device_node *device, int index, * This function resolves an interrupt for a device, no translation is * made. dt_irq_translate can be called after. */ -int dt_device_get_raw_irq(const struct dt_device_node *device, int index, +int dt_device_get_raw_irq(const struct dt_device_node *device, + unsigned int index, struct dt_raw_irq *irq); /**