From patchwork Fri Apr 12 20:44:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 236185 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 C83E82C0099 for ; Sat, 13 Apr 2013 06:45:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 583E04A025; Fri, 12 Apr 2013 22:45:11 +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 oZrpPi4BQDYx; Fri, 12 Apr 2013 22:45:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E88874A028; Fri, 12 Apr 2013 22:45:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B14B24A028 for ; Fri, 12 Apr 2013 22:45:06 +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 n5Wq9LLJFqq9 for ; Fri, 12 Apr 2013 22:45:05 +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-qe0-f74.google.com (mail-qe0-f74.google.com [209.85.128.74]) by theia.denx.de (Postfix) with ESMTPS id 3D8A74A025 for ; Fri, 12 Apr 2013 22:45:03 +0200 (CEST) Received: by mail-qe0-f74.google.com with SMTP id b10so287450qen.1 for ; Fri, 12 Apr 2013 13:45:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=cI2/NgiW7y4a+VYvgjR9GM7Ex8a6RbfhsaZ2g5GqeyA=; b=TmZ083l/CWcP2Rindr44uFLh/sHmJaFuyMYPoa14qNUY2R7DA+fbAeg2tFL3f12SDQ T1Q/a20nraxLSA4RTIhG27Wr/0+C5Ju3fa8ALw/uTb5HqJt8Ew78/1jCNbWcEg8DBkwQ vWexzrB5W+CJEGYT98Vz2Scpay4bDsxoMCGfOW6BxcXG6xgPnqqSZss0RcCunWQIFCGD uDkgzbRmZc9F5NLwTc9CAyfTOegY2yKYNiBv74L3915VAWL8uHM3F8/4uD5j24/KmGGt KGhV6B3AmdTT6zdP5ga6knxEx+ydfVxeCYvz4rcYql3Tt6rDi4J2nADTB+jinCxiusiM KLVg== X-Received: by 10.236.117.145 with SMTP id j17mr6288730yhh.21.1365799502135; Fri, 12 Apr 2013 13:45:02 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id p70si523600yhd.5.2013.04.12.13.45.02 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Fri, 12 Apr 2013 13:45:02 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id EFEE231C107; Fri, 12 Apr 2013 13:45:01 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 7F1701609C4; Fri, 12 Apr 2013 13:45:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 12 Apr 2013 13:44:56 -0700 Message-Id: <1365799498-17895-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 X-Gm-Message-State: ALoCoQmTfhU08K0FSqQg8jaYj+QoDM8Mtl/g3XiEuoM/pJ22VB9misvCnjHE+qEbqa7CC9QW6xoyTAxDUNJ4K6U8rBLw0S21L6+PfkvthyhbeemO83sQVZtzg97u9Pu4j+6sgM19n8NYM6LptnoxshcXgumh9i1jmqMTLQF8ka9kLnCns81bZ4GS79OsulK3KLvH3HDXAaSU Cc: Tom Rini , Vadim Bendebury , u-boot-review@google.com, Taylor Hutt Subject: [U-Boot] [PATCH v2 1/3] tpm: Add casts for proper compilation 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 From: Taylor Hutt When building for the Sandbox version, the casts in this change are necessary to avoid compilation issues. Signed-off-by: Taylor Hutt Signed-off-by: Simon Glass Reviewed-by: Simon Glass --- Changes in v2: None drivers/tpm/generic_lpc_tpm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/tpm/generic_lpc_tpm.c b/drivers/tpm/generic_lpc_tpm.c index 6c494eb..04ad418 100644 --- a/drivers/tpm/generic_lpc_tpm.c +++ b/drivers/tpm/generic_lpc_tpm.c @@ -135,7 +135,7 @@ static u8 tpm_read_byte(const u8 *ptr) { u8 ret = readb(ptr); debug(PREFIX "Read reg 0x%4.4x returns 0x%2.2x\n", - (u32)ptr - (u32)lpc_tpm_dev, ret); + (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, ret); return ret; } @@ -143,21 +143,21 @@ static u32 tpm_read_word(const u32 *ptr) { u32 ret = readl(ptr); debug(PREFIX "Read reg 0x%4.4x returns 0x%8.8x\n", - (u32)ptr - (u32)lpc_tpm_dev, ret); + (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, ret); return ret; } static void tpm_write_byte(u8 value, u8 *ptr) { debug(PREFIX "Write reg 0x%4.4x with 0x%2.2x\n", - (u32)ptr - (u32)lpc_tpm_dev, value); + (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, value); writeb(value, ptr); } static void tpm_write_word(u32 value, u32 *ptr) { debug(PREFIX "Write reg 0x%4.4x with 0x%8.8x\n", - (u32)ptr - (u32)lpc_tpm_dev, value); + (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, value); writel(value, ptr); } @@ -491,5 +491,5 @@ int tis_sendrecv(const u8 *sendbuf, size_t send_size, return TPM_DRIVER_ERR; } - return tis_readresponse(recvbuf, recv_len); + return tis_readresponse(recvbuf, (u32 *)recv_len); }