summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'mkbootimg/mkbootimg.c')
-rw-r--r--mkbootimg/mkbootimg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mkbootimg/mkbootimg.c b/mkbootimg/mkbootimg.c
index a7daccc21..fc92b4dc3 100644
--- a/mkbootimg/mkbootimg.c
+++ b/mkbootimg/mkbootimg.c
@@ -77,7 +77,7 @@ static unsigned char padding[16384] = { 0, };
77int write_padding(int fd, unsigned pagesize, unsigned itemsize) 77int write_padding(int fd, unsigned pagesize, unsigned itemsize)
78{ 78{
79 unsigned pagemask = pagesize - 1; 79 unsigned pagemask = pagesize - 1;
80 unsigned count; 80 ssize_t count;
81 81
82 if((itemsize & pagemask) == 0) { 82 if((itemsize & pagemask) == 0) {
83 return 0; 83 return 0;
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
108 unsigned pagesize = 2048; 108 unsigned pagesize = 2048;
109 int fd; 109 int fd;
110 SHA_CTX ctx; 110 SHA_CTX ctx;
111 uint8_t* sha; 111 const uint8_t* sha;
112 unsigned base = 0x10000000; 112 unsigned base = 0x10000000;
113 unsigned kernel_offset = 0x00008000; 113 unsigned kernel_offset = 0x00008000;
114 unsigned ramdisk_offset = 0x01000000; 114 unsigned ramdisk_offset = 0x01000000;
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
189 return usage(); 189 return usage();
190 } 190 }
191 191
192 strcpy(hdr.name, board); 192 strcpy((char *) hdr.name, board);
193 193
194 memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE); 194 memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE);
195 195
@@ -255,14 +255,14 @@ int main(int argc, char **argv)
255 if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail; 255 if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail;
256 if(write_padding(fd, pagesize, sizeof(hdr))) goto fail; 256 if(write_padding(fd, pagesize, sizeof(hdr))) goto fail;
257 257
258 if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail; 258 if(write(fd, kernel_data, hdr.kernel_size) != (ssize_t) hdr.kernel_size) goto fail;
259 if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail; 259 if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail;
260 260
261 if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail; 261 if(write(fd, ramdisk_data, hdr.ramdisk_size) != (ssize_t) hdr.ramdisk_size) goto fail;
262 if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail; 262 if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
263 263
264 if(second_data) { 264 if(second_data) {
265 if(write(fd, second_data, hdr.second_size) != hdr.second_size) goto fail; 265 if(write(fd, second_data, hdr.second_size) != (ssize_t) hdr.second_size) goto fail;
266 if(write_padding(fd, pagesize, hdr.second_size)) goto fail; 266 if(write_padding(fd, pagesize, hdr.second_size)) goto fail;
267 } 267 }
268 268