From patchwork Mon Mar 5 18:12:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hobbs X-Patchwork-Id: 144737 X-Patchwork-Delegate: agust@denx.de 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 87D6FB6FB4 for ; Tue, 6 Mar 2012 05:13:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 36B3C280A9; Mon, 5 Mar 2012 19:13:17 +0100 (CET) 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 VATrP8wyJ1qW; Mon, 5 Mar 2012 19:13:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1375280A1; Mon, 5 Mar 2012 19:13:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AEC55280A1 for ; Mon, 5 Mar 2012 19:13:13 +0100 (CET) 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 ptSEJxuhqr7K for ; Mon, 5 Mar 2012 19:13:13 +0100 (CET) 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 smtp125.dfw.emailsrvr.com (smtp125.dfw.emailsrvr.com [67.192.241.125]) by theia.denx.de (Postfix) with ESMTPS id 1FF662808F for ; Mon, 5 Mar 2012 19:13:11 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp22.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 040B21718CA; Mon, 5 Mar 2012 13:13:10 -0500 (EST) X-Virus-Scanned: OK Received: by smtp22.relay.dfw1a.emailsrvr.com (Authenticated sender: jason.hobbs-AT-calxeda.com) with ESMTPSA id 9877217189D; Mon, 5 Mar 2012 13:13:08 -0500 (EST) Received: by jhobbs-laptop (sSMTP sendmail emulation); Mon, 05 Mar 2012 12:12:42 -0600 From: "Jason Hobbs" To: u-boot@lists.denx.de Date: Mon, 5 Mar 2012 12:12:28 -0600 Message-Id: <1330971148-12677-1-git-send-email-jason.hobbs@calxeda.com> X-Mailer: git-send-email 1.7.5.4 Cc: Marek Vasut , Heiko Schocher Subject: [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing 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 Without this patch, some versions of gcc (at least ELDK 4.2) complain about dereferencing type-punned pointers. Reported-by: Marek Vasut Signed-off-by: Jason Hobbs Cc: Heiko Schocher Cc: Marek Vasut Acked-by: Heiko Schocher --- common/cmd_pxe.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 7c0cb66..ea95e59 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -318,7 +318,7 @@ static int do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *pxefile_addr_str; - void *pxefile_addr_r; + unsigned long pxefile_addr_r; int err; if (argc != 1) @@ -339,10 +339,10 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * Keep trying paths until we successfully get a file we're looking * for. */ - if (pxe_uuid_path(pxefile_addr_r) > 0 - || pxe_mac_path(pxefile_addr_r) > 0 - || pxe_ipaddr_paths(pxefile_addr_r) > 0 - || get_pxelinux_path("default", pxefile_addr_r) > 0) { + if (pxe_uuid_path((void *)pxefile_addr_r) > 0 + || pxe_mac_path((void *)pxefile_addr_r) > 0 + || pxe_ipaddr_paths((void *)pxefile_addr_r) > 0 + || get_pxelinux_path("default", (void *)pxefile_addr_r) > 0) { printf("Config file found\n"); @@ -363,7 +363,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ static int get_relfile_envaddr(char *file_path, char *envaddr_name) { - void *file_addr; + unsigned long file_addr; char *envaddr; envaddr = from_env(envaddr_name); @@ -371,10 +371,10 @@ static int get_relfile_envaddr(char *file_path, char *envaddr_name) if (!envaddr) return -ENOENT; - if (strict_strtoul(envaddr, 16, (unsigned long *)&file_addr) < 0) + if (strict_strtoul(envaddr, 16, &file_addr) < 0) return -EINVAL; - return get_relfile(file_path, file_addr); + return get_relfile(file_path, (void *)file_addr); } /*