From patchwork Wed May 4 05:20:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 67105 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp955953qge; Tue, 3 May 2016 22:19:47 -0700 (PDT) X-Received: by 10.28.39.196 with SMTP id n187mr6852233wmn.4.1462339187390; Tue, 03 May 2016 22:19:47 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id c84si2692995wmf.65.2016.05.03.22.19.47; Tue, 03 May 2016 22:19:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70A2DA76D1; Wed, 4 May 2016 07:19:46 +0200 (CEST) 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 aA8cQTVLmWtJ; Wed, 4 May 2016 07:19:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C0676A7620; Wed, 4 May 2016 07:19:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE410A7620 for ; Wed, 4 May 2016 07:19:41 +0200 (CEST) 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 bTFERRvZ-U7Z for ; Wed, 4 May 2016 07:19:41 +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 conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by theia.denx.de (Postfix) with ESMTPS id 1CADDA75C8 for ; Wed, 4 May 2016 07:19:37 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u445J2FW003504; Wed, 4 May 2016 14:19:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u445J2FW003504 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1462339143; bh=vSG/BnFUAx+zBwlZ5/A3+/Cb/x1jxiBGMqusGTh46OA=; h=From:To:Cc:Subject:Date:From; b=S8JR0GYZpeU43vwS7l8hnM2Q7RFstwY5Oz1di1hxXdlCJ/EKsksgYTDwwULvm7E3m 1rpf4HF/zqDkCqZc/ymvdofp4z1QDacxPWOwwLj7oOzMAip3k5Yp6BjBf+UXd+WjnF NsJ/lNBcNUSLx/61Q7AaN33meP5oxVpkrqgaFGaz2R9+vPf1/jputEVzyCSCsZ71gr 8JR2PdAUOCtrKf5e4WK5NBCYjW/AcRFbPwL7lRpjzr9/fmQqtmWQEqaXYkt3LYGvyZ Xg6MK755X718Mr+Jp+ySaOUIUHcGJ0EueuXVh8Q/MxzolXmH52YC4a3n9G42OGyX5P 8cYrdlxO5TW2g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 4 May 2016 14:20:04 +0900 Message-Id: <1462339204-3362-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Cc: Stefan Roese , Stephen Warren , Kunihiko Hayashi , Przemyslaw Marczak Subject: [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Kunihiko Hayashi This patch fixes a bug that long word(.l) memory access in 'itest' command reads the 8bytes of the actual memory on 64-bit architecture. The cast to the memory pointer should use a fixed bit type. Signed-off-by: Kunihiko Hayashi Signed-off-by: Masahiro Yamada --- cmd/itest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/cmd/itest.c b/cmd/itest.c index fb4d797..60626c7 100644 --- a/cmd/itest.c +++ b/cmd/itest.c @@ -65,13 +65,13 @@ static long evalexp(char *s, int w) } switch (w) { case 1: - l = (long)(*(unsigned char *)buf); + l = (long)(*(u8 *)buf); break; case 2: - l = (long)(*(unsigned short *)buf); + l = (long)(*(u16 *)buf); break; case 4: - l = (long)(*(unsigned long *)buf); + l = (long)(*(u32 *)buf); break; } unmap_physmem(buf, w);