* [PATCH] powerpc: fix mktree build error on Mac OS X host
@ 2009-05-01 4:16 Timur Tabi
2009-05-01 12:47 ` Josh Boyer
0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2009-05-01 4:16 UTC (permalink / raw)
To: linuxppc-dev, galak
The mktree utility defines some variables as "uint", although this is not a
standard C type, and so cross-compiling on Mac OS X fails. Change this to
"unsigned int".
Signed-off-by: Timur Tabi <timur@freescale.com>
---
arch/powerpc/boot/mktree.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/boot/mktree.c b/arch/powerpc/boot/mktree.c
index 45d06a8..c2baae0 100644
--- a/arch/powerpc/boot/mktree.c
+++ b/arch/powerpc/boot/mktree.c
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
{
int in_fd, out_fd;
int nblks, i;
- uint cksum, *cp;
+ unsigned int cksum, *cp;
struct stat st;
boot_block_t bt;
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
cksum = 0;
cp = (void *)&bt;
- for (i=0; i<sizeof(bt)/sizeof(uint); i++)
+ for (i = 0; i < sizeof(bt) / sizeof(unsigned int); i++)
cksum += *cp++;
/* Assume zImage is an ELF file, and skip the 64K header.
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
exit(4);
}
- if ((*(uint *)tmpbuf) != htonl(0x7f454c46)) {
+ if ((*(unsigned int *)tmpbuf) != htonl(0x7f454c46)) {
fprintf(stderr, "%s is not an ELF image\n", argv[1]);
exit(4);
}
@@ -125,8 +125,8 @@ int main(int argc, char *argv[])
perror("zImage read");
exit(5);
}
- cp = (uint *)tmpbuf;
- for (i=0; i<sizeof(tmpbuf)/sizeof(uint); i++)
+ cp = (unsigned int *)tmpbuf;
+ for (i = 0; i < sizeof(tmpbuf) / sizeof(unsigned int); i++)
cksum += *cp++;
if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
perror("boot-image write");
--
1.6.2.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: fix mktree build error on Mac OS X host
2009-05-01 4:16 [PATCH] powerpc: fix mktree build error on Mac OS X host Timur Tabi
@ 2009-05-01 12:47 ` Josh Boyer
0 siblings, 0 replies; 2+ messages in thread
From: Josh Boyer @ 2009-05-01 12:47 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
On Thu, Apr 30, 2009 at 11:16:44PM -0500, Timur Tabi wrote:
>The mktree utility defines some variables as "uint", although this is not a
>standard C type, and so cross-compiling on Mac OS X fails. Change this to
>"unsigned int".
>
>Signed-off-by: Timur Tabi <timur@freescale.com>
I believe this is only used by the 4xx boards anyway.
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
>---
> arch/powerpc/boot/mktree.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/arch/powerpc/boot/mktree.c b/arch/powerpc/boot/mktree.c
>index 45d06a8..c2baae0 100644
>--- a/arch/powerpc/boot/mktree.c
>+++ b/arch/powerpc/boot/mktree.c
>@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
> {
> int in_fd, out_fd;
> int nblks, i;
>- uint cksum, *cp;
>+ unsigned int cksum, *cp;
> struct stat st;
> boot_block_t bt;
>
>@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
>
> cksum = 0;
> cp = (void *)&bt;
>- for (i=0; i<sizeof(bt)/sizeof(uint); i++)
>+ for (i = 0; i < sizeof(bt) / sizeof(unsigned int); i++)
> cksum += *cp++;
>
> /* Assume zImage is an ELF file, and skip the 64K header.
>@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
> exit(4);
> }
>
>- if ((*(uint *)tmpbuf) != htonl(0x7f454c46)) {
>+ if ((*(unsigned int *)tmpbuf) != htonl(0x7f454c46)) {
> fprintf(stderr, "%s is not an ELF image\n", argv[1]);
> exit(4);
> }
>@@ -125,8 +125,8 @@ int main(int argc, char *argv[])
> perror("zImage read");
> exit(5);
> }
>- cp = (uint *)tmpbuf;
>- for (i=0; i<sizeof(tmpbuf)/sizeof(uint); i++)
>+ cp = (unsigned int *)tmpbuf;
>+ for (i = 0; i < sizeof(tmpbuf) / sizeof(unsigned int); i++)
> cksum += *cp++;
> if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
> perror("boot-image write");
>--
>1.6.2.4
>
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-01 12:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01 4:16 [PATCH] powerpc: fix mktree build error on Mac OS X host Timur Tabi
2009-05-01 12:47 ` Josh Boyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).