From patchwork Tue Jan 13 14:25:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43004 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D0B620DE8 for ; Tue, 13 Jan 2015 14:28:14 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf1868992lab.0 for ; Tue, 13 Jan 2015 06:28:13 -0800 (PST) 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:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=gn+1jk6UCbdCgYKzH2PZZfQzjaGCGbFuGhym7dUPkfg=; b=ZsOVM6iEk+0+D88eIj0Fso4pSyg+R5H1ku40LzwvrK6zUXvaA1BdPi9e8RbtbqUXH0 lsEalQabXIRydjdvHTUJ9fQynFdJ58XDKlb7jsuO59kgO2AzRbf7ykFcY/tV14zgXW1o DYAyt4VCPudebPo/j8UgzAdxdlknHOQ6Si9y7IIVTeWlUFUe0Y2gTLlLjH/BkN1w4Ps6 JRKGkJnJ4tTZ/Z1+Z2A2zr7qMXeuUeWnVgXbvZd9xzUQ7gByPb6zP3KsB2bZqy1mHlR7 H9r1tf3I6/uayLxLaMH682kW9QHG3K86MDVbGS2rt288WIPkbj0T9Yyq9ODV9J+mBlzo s2Qg== X-Gm-Message-State: ALoCoQmBY6eTgqDqY6VCMobTaNQCbMISJsIHqKttCUS3lgbnsXp8HHCcwXj7Ty6eeFNTwIP0pwz1 X-Received: by 10.180.76.40 with SMTP id h8mr2899112wiw.3.1421159293462; Tue, 13 Jan 2015 06:28:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls787065lar.81.gmail; Tue, 13 Jan 2015 06:28:13 -0800 (PST) X-Received: by 10.153.5.1 with SMTP id ci1mr41683663lad.67.1421159293232; Tue, 13 Jan 2015 06:28:13 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id pw5si24372353lbb.93.2015.01.13.06.28.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 06:28:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so2808386lbv.12 for ; Tue, 13 Jan 2015 06:28:13 -0800 (PST) X-Received: by 10.152.27.8 with SMTP id p8mr42958684lag.69.1421159293146; Tue, 13 Jan 2015 06:28:13 -0800 (PST) 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.9.200 with SMTP id c8csp1398851lbb; Tue, 13 Jan 2015 06:28:12 -0800 (PST) X-Received: by 10.221.33.129 with SMTP id so1mr21539802vcb.74.1421159279893; Tue, 13 Jan 2015 06:27:59 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id vw3si8094942vcb.30.2015.01.13.06.27.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 Jan 2015 06:27:59 -0800 (PST) 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 1YB2Qn-0001Xv-2F; Tue, 13 Jan 2015 14:26:53 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB2Qj-0001RK-Rv for xen-devel@lists.xenproject.org; Tue, 13 Jan 2015 14:26:50 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id 78/87-02957-92B25B45; Tue, 13 Jan 2015 14:26:49 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1421159208!20326514!1 X-Originating-IP: [74.125.82.52] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23530 invoked from network); 13 Jan 2015 14:26:48 -0000 Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jan 2015 14:26:48 -0000 Received: by mail-wg0-f52.google.com with SMTP id x12so3223452wgg.11 for ; Tue, 13 Jan 2015 06:26:48 -0800 (PST) X-Received: by 10.180.101.98 with SMTP id ff2mr40776912wib.83.1421159204520; Tue, 13 Jan 2015 06:26:44 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id ni15sm14513482wic.18.2015.01.13.06.26.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 06:26:43 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 13 Jan 2015 14:25:23 +0000 Message-Id: <1421159133-31526-15-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v3 14/24] 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: , MIME-Version: 1.0 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: julien.grall@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.181 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: There is no reason to use signed integer for an index. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- 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 ce10574..af73b3b 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 caaf65f..19d0e45 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); /**