* [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings
@ 2012-03-05 18:12 Jason Hobbs
2012-03-07 9:17 ` Heiko Schocher
2012-03-27 13:42 ` Anatolij Gustschin
0 siblings, 2 replies; 3+ messages in thread
From: Jason Hobbs @ 2012-03-05 18:12 UTC (permalink / raw)
To: u-boot
Without this patch, some versions of gcc (at least ELDK 4.2) complain
about dereferencing type-punned pointers.
Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Marek Vasut <marex@denx.de>
---
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);
}
/*
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings
2012-03-05 18:12 [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings Jason Hobbs
@ 2012-03-07 9:17 ` Heiko Schocher
2012-03-27 13:42 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2012-03-07 9:17 UTC (permalink / raw)
To: u-boot
Hallo Jason,
Jason Hobbs wrote:
> Without this patch, some versions of gcc (at least ELDK 4.2) complain
> about dereferencing type-punned pointers.
>
> Reported-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> ---
> common/cmd_pxe.c | 16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
Thanks!
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings
2012-03-05 18:12 [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings Jason Hobbs
2012-03-07 9:17 ` Heiko Schocher
@ 2012-03-27 13:42 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2012-03-27 13:42 UTC (permalink / raw)
To: u-boot
Hello Jason,
On Mon, 5 Mar 2012 12:12:28 -0600
"Jason Hobbs" <jason.hobbs@calxeda.com> wrote:
> Without this patch, some versions of gcc (at least ELDK 4.2) complain
> about dereferencing type-punned pointers.
>
> Reported-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> ---
> common/cmd_pxe.c | 16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
Applied to u-boot-staging/agust at denx.de, thanks!
Anatolij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-27 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 18:12 [U-Boot] [PATCH] cmd_pxe.c: fix strict-aliasing warnings Jason Hobbs
2012-03-07 9:17 ` Heiko Schocher
2012-03-27 13:42 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox