Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161751
b: refs/heads/master
c: 3c15a68
h: refs/heads/master
i:
  161749: 9b54282
  161747: 908db3b
  161743: 4d1b3f9
v: v3
  • Loading branch information
Stephen Rothwell authored and Benjamin Herrenschmidt committed Aug 20, 2009
1 parent 0cc6ee7 commit 39b1844
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 903444e4297264ec0959e886695911659edb425c
refs/heads/master: 3c15a68880023722fc794018768df556f438ae98
10 changes: 5 additions & 5 deletions trunk/arch/powerpc/boot/mktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ typedef struct boot_block {
} boot_block_t;

#define IMGBLK 512
char tmpbuf[IMGBLK];
unsigned int tmpbuf[IMGBLK / sizeof(unsigned int)];

int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -95,13 +95,13 @@ int main(int argc, char *argv[])

/* Assume zImage is an ELF file, and skip the 64K header.
*/
if (read(in_fd, tmpbuf, IMGBLK) != IMGBLK) {
if (read(in_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
fprintf(stderr, "%s is too small to be an ELF image\n",
argv[1]);
exit(4);
}

if ((*(unsigned int *)tmpbuf) != htonl(0x7f454c46)) {
if (tmpbuf[0] != htonl(0x7f454c46)) {
fprintf(stderr, "%s is not an ELF image\n", argv[1]);
exit(4);
}
Expand All @@ -121,11 +121,11 @@ int main(int argc, char *argv[])
}

while (nblks-- > 0) {
if (read(in_fd, tmpbuf, IMGBLK) < 0) {
if (read(in_fd, tmpbuf, sizeof(tmpbuf)) < 0) {
perror("zImage read");
exit(5);
}
cp = (unsigned int *)tmpbuf;
cp = tmpbuf;
for (i = 0; i < sizeof(tmpbuf) / sizeof(unsigned int); i++)
cksum += *cp++;
if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
Expand Down

0 comments on commit 39b1844

Please sign in to comment.