From patchwork Thu Mar 19 19:29:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46092 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24CD821515 for ; Thu, 19 Mar 2015 19:32:09 +0000 (UTC) Received: by labgm9 with SMTP id gm9sf14225647lab.1 for ; Thu, 19 Mar 2015 12:32:08 -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: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=IFMkmg6KVWAfWixC2zjiQdVqxjv2hKeJwqECvJ0cECk=; b=mcV0qjzxlvPSQsn0m5tPEpiNtzMGmaPz4qjnzyHDPJCRnB0LfsrdyFwz9pGeY+hz26 c8sesywRrXFOPrEEg4YqujZoiww8D9u44jfMZj1nXjKqh70A2EtWmtNsgj/vTg9A6EWa vzAdtjKN8+Jmo61fpSBAsehOsbLkOyswZnPs4IfuGQx37ILw+CX8SGLt9WPAxmAGBXj7 NmvruGgMsY8AMV3OO9cGtBfdbjlqkujINsnzRmJPPb7JvHVPDIZBD0Zmrym6cIuutOJC Ukyl2lD/irIZx9JW3dB9qYyU7ucyLNPgt5tCxP8aCBbEDERtevolXz726azJWuYBckBF /qJw== X-Gm-Message-State: ALoCoQnyxfBhOJwYFx6MoBBSzJGX9jNaclTe0GiavR6Pki97/KZtWERpJnIUHkAIIPNhaRGRWOzo X-Received: by 10.112.120.136 with SMTP id lc8mr9311822lbb.24.1426793528137; Thu, 19 Mar 2015 12:32:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.227 with SMTP id b3ls285366lak.58.gmail; Thu, 19 Mar 2015 12:32:07 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr3636437lbb.41.1426793527651; Thu, 19 Mar 2015 12:32:07 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id a2si1647107lah.96.2015.03.19.12.32.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 12:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lamx15 with SMTP id x15so70763237lam.3 for ; Thu, 19 Mar 2015 12:32:07 -0700 (PDT) X-Received: by 10.112.130.100 with SMTP id od4mr47456808lbb.86.1426793527434; Thu, 19 Mar 2015 12:32:07 -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.35.133 with SMTP id h5csp597408lbj; Thu, 19 Mar 2015 12:32:06 -0700 (PDT) X-Received: by 10.53.7.232 with SMTP id df8mr11888815vdd.90.1426793524170; Thu, 19 Mar 2015 12:32:04 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id e1si1953234vdk.78.2015.03.19.12.32.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 12:32:04 -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 1YYg9W-0004D3-79; Thu, 19 Mar 2015 19:30:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYg9U-0004CP-NC for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 19:30:44 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 8E/D0-24808-3E32B055; Thu, 19 Mar 2015 19:30:43 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-11.tower-31.messagelabs.com!1426793441!13832658!1 X-Originating-IP: [209.85.212.170] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23842 invoked from network); 19 Mar 2015 19:30:41 -0000 Received: from mail-wi0-f170.google.com (HELO mail-wi0-f170.google.com) (209.85.212.170) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 19 Mar 2015 19:30:41 -0000 Received: by wixw10 with SMTP id w10so78644076wix.0 for ; Thu, 19 Mar 2015 12:30:41 -0700 (PDT) X-Received: by 10.180.23.99 with SMTP id l3mr18690736wif.36.1426793441187; Thu, 19 Mar 2015 12:30:41 -0700 (PDT) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id hl8sm3203005wjb.38.2015.03.19.12.30.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 12:30:40 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 19 Mar 2015 19:29:29 +0000 Message-Id: <1426793399-6283-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v4 03/33] 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.215.54 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 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); /**