aboutsummaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorChris Ruffin <cmruffin@gmail.com>2011-01-12 16:59:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 08:03:08 -0800
commitb8cb464e4a8abc60ad5a43e0375fec8a3c728167 (patch)
tree963814e8a73c5ead81be22863d880f151b991eab /firmware
parent8369744fc4418743d3d84a8490d576e3dbf01594 (diff)
downloadlinux-stericsson-b8cb464e4a8abc60ad5a43e0375fec8a3c728167.tar.gz
ihex: fix unused return value compiler warning
Fix unusued return value compiler warnings due to unchecked write() calls. [akpm@linux-foundation.org: correctly handle short writes] Signed-off-by: Chris Ruffin <cmruffin@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/ihex2fw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c
index ba0cf0b601bb..cf38e159131a 100644
--- a/firmware/ihex2fw.c
+++ b/firmware/ihex2fw.c
@@ -124,8 +124,7 @@ int main(int argc, char **argv)
if (process_ihex(data, st.st_size))
return 1;
- output_records(outfd);
- return 0;
+ return output_records(outfd);
}
static int process_ihex(uint8_t *data, ssize_t size)
@@ -269,11 +268,13 @@ static int output_records(int outfd)
p->addr = htonl(p->addr);
p->len = htons(p->len);
- write(outfd, &p->addr, writelen);
+ if (write(outfd, &p->addr, writelen) != writelen)
+ return 1;
p = p->next;
}
/* EOF record is zero length, since we don't bother to represent
the type field in the binary version */
- write(outfd, zeroes, 6);
+ if (write(outfd, zeroes, 6) != 6)
+ return 1;
return 0;
}