From patchwork Tue Aug 26 10:46:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasili Galka X-Patchwork-Id: 383038 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 361021400D7 for ; Tue, 26 Aug 2014 20:46:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9E75B37AB; Tue, 26 Aug 2014 12:46:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MNmNQaZyBD30; Tue, 26 Aug 2014 12:46:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 20230B37AD; Tue, 26 Aug 2014 12:46:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 35D31B3798 for ; Tue, 26 Aug 2014 12:46:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v2BaLGJIr0Gs for ; Tue, 26 Aug 2014 12:46:34 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by theia.denx.de (Postfix) with ESMTPS id 6DA07B37A6 for ; Tue, 26 Aug 2014 12:46:24 +0200 (CEST) Received: by mail-wg0-f48.google.com with SMTP id x13so14403500wgg.7 for ; Tue, 26 Aug 2014 03:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Qr+eGT5IC4snE62PNqmH+6ktui37YOb0reEl88Xnt6U=; b=I42cNbt9tFhP+ZmPbakbpiPnX+TZQdF/PIqO/ZKJTpt3+YBuec12YFz2mqXR1eCg5P df6vMQLeUrvpWSShlFExuzaU4CzIsIeLfIVXSxLp6kOaCeVAiKHrsMx9uJbO3YP05oZk 0+qgboTUVIz73asXA4CukNqii6EMMGwyWNNsDdbPAmybywPjQRdTWYrz6O0rLphdS0Km Z4UZLZvnv0bisLLzqrNpDu9Os/an+kegvkLsZm/Fx+aSB+HYbfjywuM7fYRxL2fPK2Lc Ia1Ll8KH1Bx5rXrw8sd3nAb5yBZIPA4Uz5Lgj43kyB1GCCden9gwFE7JSdU2Vm79pEwk 7lXg== X-Received: by 10.194.202.165 with SMTP id kj5mr2507069wjc.50.1409049984557; Tue, 26 Aug 2014 03:46:24 -0700 (PDT) Received: from vasili.visionmap.co.il (vpn.visionmap.com. [82.80.119.226]) by mx.google.com with ESMTPSA id am1sm7259342wjc.29.2014.08.26.03.46.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 03:46:23 -0700 (PDT) From: Vasili Galka To: u-boot@lists.denx.de Date: Tue, 26 Aug 2014 13:46:17 +0300 Message-Id: <1409049977-9192-1-git-send-email-vvv444@gmail.com> X-Mailer: git-send-email 1.7.9 Cc: Vasili Galka Subject: [U-Boot] [PATCH] openrisc: Fix a few type cast related warnings X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Use size_t type for positive offsets instead of the loff_t type. The later is defined as long long, which is larger than the pointer type on OpenRISC architecture and therefore the following warning was generated: "warning: cast to pointer from integer of different size" Signed-off-by: Vasili Galka --- drivers/net/ethoc.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index af06d4f..46c82bb 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -189,12 +189,12 @@ struct ethoc_bd { u32 addr; }; -static inline u32 ethoc_read(struct eth_device *dev, loff_t offset) +static inline u32 ethoc_read(struct eth_device *dev, size_t offset) { return readl(dev->iobase + offset); } -static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data) +static inline void ethoc_write(struct eth_device *dev, size_t offset, u32 data) { writel(data, dev->iobase + offset); } @@ -202,7 +202,7 @@ static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data) static inline void ethoc_read_bd(struct eth_device *dev, int index, struct ethoc_bd *bd) { - loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); + size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); bd->stat = ethoc_read(dev, offset + 0); bd->addr = ethoc_read(dev, offset + 4); } @@ -210,7 +210,7 @@ static inline void ethoc_read_bd(struct eth_device *dev, int index, static inline void ethoc_write_bd(struct eth_device *dev, int index, const struct ethoc_bd *bd) { - loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); + size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); ethoc_write(dev, offset + 0, bd->stat); ethoc_write(dev, offset + 4, bd->addr); }